Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Sep 18, 2025

Important

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

  • 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 types DeleteMembershipRequest and MembershipDeletionResponse in types/.
  • API Documentation:
    • Updated reference.md with new endpoints and usage examples for blob storage integrations and memberships.
  • Miscellaneous:
    • Updated README.md to correct a typo.
    • Updated test_http_client.py and test_query_encoding.py to reflect changes in request handling.

This description was created by Ellipsis for f6d0bc7. You can customize this summary. It will automatically update as commits are pushed.

Disclaimer: Experimental PR review

Greptile Summary

Updated On: 2025-09-18 10:21:28 UTC

This PR implements an automated API specification update from the main Langfuse repository (commit 27cfbb14a17f4c444b45b33c5d5bf413ad43aa89), adding significant new functionality to the Python SDK. The changes introduce blob storage integrations - a new feature that allows users to configure and manage external cloud storage connections (S3, S3-compatible, Azure Blob Storage) for automated data exports with configurable frequencies and file formats. Additionally, the PR enhances organization membership management by adding DELETE endpoints for removing user memberships from organizations and projects.

The implementation follows established patterns throughout the codebase with proper Pydantic models, both synchronous and asynchronous client support, and consistent error handling. The changes include 8 new blob storage integration types (export frequencies, modes, file types, etc.), new request/response models for membership deletion, and enhanced API documentation. The PR also adds session-based filtering to the ScoreV2 endpoint and marks the legacy batch ingestion endpoint as deprecated in favor of OpenTelemetry standards.

Since this is an auto-generated update from the API specification using Fern, all changes maintain consistency with existing code patterns and maintain backward compatibility. The new blob storage integrations feature appears to target enterprise users needing data export capabilities, while the membership management enhancements provide better organizational control features.

Confidence score: 1/5

  • This PR has critical import path issues that will cause immediate runtime failures
  • Score severely lowered due to broken import statements in test files that reference non-existent modules
  • Pay close attention to langfuse/api/tests/utils/test_http_client.py and langfuse/api/tests/utils/test_query_encoding.py - these contain imports to langfuse.core.* modules that don't exist in the repository structure

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, 3 comments

Edit Code Review Bot Settings | Greptile

Comment on lines +14 to +25
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()
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 - if self doesn't match any enum value, this method will implicitly return None instead of T_Result, violating the type contract

Suggested change
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}")

Comment on lines +20 to +25
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: The visit method is missing a fallback case. If an unexpected enum value is encountered, the method will implicitly return None, which could cause runtime errors.

Comment on lines +19 to +25
) -> 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()
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 a new enum value is added but not handled, this will return None implicitly, potentially causing runtime errors

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.

2 participants