Skip to content

Conversation

@maxdeichmann
Copy link
Member

@maxdeichmann maxdeichmann commented Sep 17, 2025

Important

This PR adds functionality for managing blob storage integrations and organization memberships, including new client methods and types, along with updated API documentation.

  • Blob Storage Integrations:
    • Added BlobStorageIntegrationsClient and AsyncBlobStorageIntegrationsClient in client.py for managing blob storage integrations.
    • Introduced methods: get_blob_storage_integrations(), upsert_blob_storage_integration(), and delete_blob_storage_integration().
    • Added types for blob storage integration in types/.
  • Organization Memberships:
    • Added methods in OrganizationsClient and AsyncOrganizationsClient for managing organization memberships.
    • Introduced methods: delete_organization_membership() and delete_project_membership().
    • Added DeleteMembershipRequest and MembershipDeletionResponse types.
  • API Documentation:
    • Updated API documentation to reflect new methods and parameters.
    • Added examples for new methods in docstrings.
  • Miscellaneous:
    • Updated README.md to correct a typo.
    • Minor changes in test_http_client.py and test_query_encoding.py for consistency.

This description was created by Ellipsis for 42c4395. 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:44:07 UTC

This PR is an automated API specification update from the main Langfuse repository (commit 83d3009331ce11dc5fda825bc4dd5d4ced913a53) that introduces significant new functionality to the Python SDK. The changes are auto-generated by Fern from OpenAPI specifications, ensuring consistency between the backend API and client library.

Key additions include:

  1. Blob Storage Integrations: A complete new API resource supporting S3, S3-compatible, and Azure Blob Storage integrations for automated data exports. This includes:

    • Full CRUD operations (get, create/upsert, delete)
    • Support for different export frequencies (hourly, daily, weekly)
    • Multiple export modes (full history, from today, from custom date)
    • Various file formats (JSON, CSV, JSONL)
    • Comprehensive configuration including authentication, scheduling, and export settings
  2. Organization Membership Management: Enhanced organization administration with new DELETE endpoints for removing memberships at both organization and project levels, including proper request/response types.

  3. Enhanced Score Filtering: Added session_id parameter to ScoreV2 endpoints, allowing more granular filtering of scores by session.

  4. Documentation Updates:

    • The legacy ingestion endpoint is now marked as deprecated with guidance to use OpenTelemetry
    • Improved documentation for the trace list endpoint's fields parameter
    • Updated terminology from 'Tracing' to 'Observability'
  5. Structural Improvements: Core utilities have been moved from langfuse.api.core.* to langfuse.core.*, simplifying the module hierarchy.

All changes follow established patterns in the codebase: Pydantic v1 models with proper field aliasing, consistent serialization methods, immutable configuration, and both sync/async client implementations. The auto-generated nature ensures type safety and maintains architectural consistency across the SDK.

Confidence score: 3/5

  • This PR is mostly safe to merge but requires attention to specific enum implementation issues
  • Score reflects that while most changes are standard auto-generated additions, there are critical bugs in visitor pattern implementations for new enum classes
  • Pay close attention to blob storage integration enum files which have incomplete visitor methods that could cause runtime errors

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

26 files reviewed, 4 comments

Edit Code Review Bot Settings | Greptile

Comment on lines +20 to +25
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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing fallback case - method could return None if enum has unexpected value, violating return type annotation

Comment on lines +19 to +25
) -> T_Result:
if self is BlobStorageIntegrationFileType.JSON:
return json()
if self is BlobStorageIntegrationFileType.CSV:
return csv()
if self is BlobStorageIntegrationFileType.JSONL:
return jsonl()
Copy link
Contributor

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 unexpected enum value exists, this method will return None instead of T_Result, potentially causing runtime errors

Comment on lines +14 to +25
def visit(
self,
full_history: typing.Callable[[], T_Result],
from_today: typing.Callable[[], T_Result],
from_custom_date: typing.Callable[[], T_Result],
) -> 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()
Copy link
Contributor

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 self doesn't match any of the enum values, the method will implicitly return None instead of T_Result, violating the return type annotation

Suggested change
def visit(
self,
full_history: typing.Callable[[], T_Result],
from_today: typing.Callable[[], T_Result],
from_custom_date: typing.Callable[[], T_Result],
) -> 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()
def visit(
self,
full_history: typing.Callable[[], T_Result],
from_today: typing.Callable[[], T_Result],
from_custom_date: typing.Callable[[], T_Result],
) -> 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}")

Comment on lines +19 to +25
) -> T_Result:
if self is BlobStorageExportFrequency.HOURLY:
return hourly()
if self is BlobStorageExportFrequency.DAILY:
return daily()
if self is BlobStorageExportFrequency.WEEKLY:
return weekly()
Copy link
Contributor

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 unexpected enum value exists, this method will implicitly return None instead of T_Result, violating the return type annotation

Suggested change
) -> T_Result:
if self is BlobStorageExportFrequency.HOURLY:
return hourly()
if self is BlobStorageExportFrequency.DAILY:
return daily()
if self is BlobStorageExportFrequency.WEEKLY:
return weekly()
) -> T_Result:
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}")

@hassiebp hassiebp closed this Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants