-
Notifications
You must be signed in to change notification settings - Fork 224
Update Python SDK API spec #1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Python SDK API spec #1351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
26 files reviewed, 5 comments
| if self is BlobStorageExportFrequency.HOURLY: | ||
| return hourly() | ||
| if self is BlobStorageExportFrequency.DAILY: | ||
| return daily() | ||
| if self is BlobStorageExportFrequency.WEEKLY: | ||
| return weekly() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing fallback case in visitor pattern - if an unknown enum value exists, the method returns None implicitly instead of raising an error
| if self is BlobStorageExportFrequency.HOURLY: | |
| return hourly() | |
| if self is BlobStorageExportFrequency.DAILY: | |
| return daily() | |
| if self is BlobStorageExportFrequency.WEEKLY: | |
| return weekly() | |
| if self is BlobStorageExportFrequency.HOURLY: | |
| return hourly() | |
| if self is BlobStorageExportFrequency.DAILY: | |
| return daily() | |
| if self is BlobStorageExportFrequency.WEEKLY: | |
| return weekly() | |
| raise ValueError(f"Unknown BlobStorageExportFrequency: {self}") |
| ) -> T_Result: | ||
| if self is BlobStorageIntegrationType.S_3: | ||
| return s_3() | ||
| if self is BlobStorageIntegrationType.S_3_COMPATIBLE: | ||
| return s_3_compatible() | ||
| if self is BlobStorageIntegrationType.AZURE_BLOB_STORAGE: | ||
| return azure_blob_storage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing fallback case - if an unexpected enum value exists, this method will return None instead of T_Result, violating the return type annotation
| ) -> T_Result: | |
| if self is BlobStorageIntegrationType.S_3: | |
| return s_3() | |
| if self is BlobStorageIntegrationType.S_3_COMPATIBLE: | |
| return s_3_compatible() | |
| if self is BlobStorageIntegrationType.AZURE_BLOB_STORAGE: | |
| return azure_blob_storage() | |
| ) -> T_Result: | |
| if self is BlobStorageIntegrationType.S_3: | |
| return s_3() | |
| if self is BlobStorageIntegrationType.S_3_COMPATIBLE: | |
| return s_3_compatible() | |
| if self is BlobStorageIntegrationType.AZURE_BLOB_STORAGE: | |
| return azure_blob_storage() | |
| raise ValueError(f"Unknown BlobStorageIntegrationType: {self}") |
| ) -> T_Result: | ||
| if self is BlobStorageExportMode.FULL_HISTORY: | ||
| return full_history() | ||
| if self is BlobStorageExportMode.FROM_TODAY: | ||
| return from_today() | ||
| if self is BlobStorageExportMode.FROM_CUSTOM_DATE: | ||
| return from_custom_date() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The visit method is missing a fallback case - if self doesn't match any of the defined enum values, the method will return None instead of T_Result, violating the type contract. This is a critical logical error that could cause runtime issues.
| ) -> T_Result: | |
| if self is BlobStorageExportMode.FULL_HISTORY: | |
| return full_history() | |
| if self is BlobStorageExportMode.FROM_TODAY: | |
| return from_today() | |
| if self is BlobStorageExportMode.FROM_CUSTOM_DATE: | |
| return from_custom_date() | |
| ) -> T_Result: | |
| if self is BlobStorageExportMode.FULL_HISTORY: | |
| return full_history() | |
| if self is BlobStorageExportMode.FROM_TODAY: | |
| return from_today() | |
| if self is BlobStorageExportMode.FROM_CUSTOM_DATE: | |
| return from_custom_date() | |
| raise ValueError(f"Unknown BlobStorageExportMode: {self}") |
| def visit( | ||
| self, | ||
| json: typing.Callable[[], T_Result], | ||
| csv: typing.Callable[[], T_Result], | ||
| jsonl: typing.Callable[[], T_Result], | ||
| ) -> T_Result: | ||
| if self is BlobStorageIntegrationFileType.JSON: | ||
| return json() | ||
| if self is BlobStorageIntegrationFileType.CSV: | ||
| return csv() | ||
| if self is BlobStorageIntegrationFileType.JSONL: | ||
| return jsonl() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing fallback case in visit method - if an invalid enum value exists, this will return None instead of T_Result, violating the return type annotation
| def visit( | |
| self, | |
| json: typing.Callable[[], T_Result], | |
| csv: typing.Callable[[], T_Result], | |
| jsonl: typing.Callable[[], T_Result], | |
| ) -> T_Result: | |
| if self is BlobStorageIntegrationFileType.JSON: | |
| return json() | |
| if self is BlobStorageIntegrationFileType.CSV: | |
| return csv() | |
| if self is BlobStorageIntegrationFileType.JSONL: | |
| return jsonl() | |
| def visit( | |
| self, | |
| json: typing.Callable[[], T_Result], | |
| csv: typing.Callable[[], T_Result], | |
| jsonl: typing.Callable[[], T_Result], | |
| ) -> T_Result: | |
| if self is BlobStorageIntegrationFileType.JSON: | |
| return json() | |
| if self is BlobStorageIntegrationFileType.CSV: | |
| return csv() | |
| if self is BlobStorageIntegrationFileType.JSONL: | |
| return jsonl() | |
| raise ValueError(f"Unknown BlobStorageIntegrationFileType: {self}") |
| from langfuse.core.http_client import get_request_body | ||
| from langfuse.core.request_options import RequestOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Import paths changed from langfuse.api.core to langfuse.core, but based on repository structure, these modules don't exist at the new location. This will cause ImportError when tests run.
Important
Add blob storage integration management to Langfuse Python SDK, including creation, update, and deletion functionalities.
BlobStorageIntegrationsClientandAsyncBlobStorageIntegrationsClientinclient.pyto manage blob storage integrations.get_blob_storage_integrations(),upsert_blob_storage_integration(), anddelete_blob_storage_integration().types/.delete_organization_membership()anddelete_project_membership()inorganizations/client.py.DeleteMembershipRequestandMembershipDeletionResponsetypes.reference.mdwith new blob storage integration endpoints and examples.README.md.test_http_client.pyandtest_query_encoding.pyto reflect changes in core imports.This description was created by
for e9dd740. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
Updated On: 2025-09-17 15:31:05 UTC
This PR is a comprehensive auto-generated API specification update that adds significant new functionality to the Langfuse Python SDK. The changes introduce a complete blob storage integrations feature with support for S3, S3-compatible, and Azure Blob Storage providers, enabling automated data exports with configurable frequencies (hourly, daily, weekly) and file formats (JSON, CSV, JSONL). The PR also adds organization membership deletion capabilities through new request/response models and client methods.
Key additions include:
get,upsert,delete) with proper request/response models and configuration enumssession_idparameter to ScoreV2 filtering and marked the ingestion endpoint as legacy in favor of OpenTelemetryThe changes follow established patterns throughout the codebase, using Pydantic v1 for validation, consistent serialization methods, and proper field aliasing for camelCase/snake_case conversion. All new functionality is properly integrated into the main API client with both synchronous and asynchronous implementations.
Confidence score: 2/5
Noneand incorrect import path changes that will break tests