Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

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

Important

This pull request adds functionality for managing blob storage integrations and organization memberships, including new client methods and types, along with updates to API documentation and minor code improvements.

  • Blob Storage Integrations:
    • Added BlobStorageIntegrationsClient and AsyncBlobStorageIntegrationsClient in client.py to manage 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 client.py for managing organization memberships: delete_organization_membership() and delete_project_membership().
    • Introduced DeleteMembershipRequest and MembershipDeletionResponse types.
  • API Documentation:
    • Updated reference.md with new endpoints and usage examples for blob storage integrations and memberships.
    • Clarified legacy endpoint usage in ingestion/client.py.
  • Miscellaneous:
    • Minor updates to README.md and test_http_client.py for clarity and consistency.

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

Disclaimer: Experimental PR review

Greptile Summary

Updated On: 2025-09-17 16:43:41 UTC

This PR updates the Langfuse Python client with auto-generated API changes from the main Langfuse repository (commit 6379c7c54bd2c19071777b9477878d24d5aa3c22). The changes introduce comprehensive blob storage integration functionality and enhance organization membership management capabilities.

Major additions include:

  • Blob Storage Integrations API: Complete CRUD operations for configuring external blob storage services (AWS S3, S3-compatible storage, Azure Blob Storage) with support for different export modes (full history, from today, from custom date), frequencies (hourly, daily, weekly), and file formats (JSON, CSV, JSONL)
  • Organization Membership Deletion: New endpoints for deleting organization and project memberships, completing the CRUD operations for membership management
  • Enhanced Score Filtering: Added session_id parameter to the ScoreV2 API for session-specific score filtering
  • API Documentation Updates: Marked the batch ingestion endpoint as legacy with recommendations to use OpenTelemetry, and improved field parameter documentation for trace listing

The blob storage integration feature appears designed for enterprise customers who need to export their Langfuse observability data to their own storage systems. The comprehensive type system includes enums for export configurations (BlobStorageExportMode, BlobStorageExportFrequency), storage providers (BlobStorageIntegrationType), file formats (BlobStorageIntegrationFileType), and corresponding request/response models.

All changes follow the established patterns in the codebase for auto-generated API clients, with proper Pydantic models, field aliasing, serialization methods, and error handling. The module structure maintains consistency with existing resource organization, and both synchronous and asynchronous client variants are provided.

This update also includes minor infrastructure changes like import path restructuring (moving core utilities from langfuse.api.core to langfuse.core) and documentation URL updates reflecting the shift towards OpenTelemetry as the preferred observability standard.

Confidence score: 3/5

  • This PR requires careful attention due to multiple enum visitor pattern implementations that lack proper fallback error handling
  • Score reflects concerns about incomplete visitor methods in several new enum classes that could cause runtime failures with unexpected values
  • Pay close attention to blob storage integration enum files (blob_storage_integration_file_type.py, blob_storage_export_mode.py, blob_storage_export_frequency.py) and verify core module restructuring doesn't break existing functionality

Context used:

Rule - Open a GitHub issue or discussion first before submitting PRs to explain the rationale and necessity of the proposed changes, as required by the contributing guide. (link)

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 in visit method - if an unexpected enum value exists, this will return None instead of raising an error

Comment on lines +19 to +25
) -> 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 an unexpected enum value exists, this will return None instead of raising an error, potentially causing silent failures

Suggested change
) -> 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"Unexpected BlobStorageExportMode value: {self}")

Comment on lines +14 to +25
def visit(
self,
hourly: typing.Callable[[], T_Result],
daily: typing.Callable[[], T_Result],
weekly: typing.Callable[[], T_Result],
) -> 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: The visit method doesn't handle cases where the enum value doesn't match any of the expected values, which could lead to None being returned instead of raising an error

Suggested change
def visit(
self,
hourly: typing.Callable[[], T_Result],
daily: typing.Callable[[], T_Result],
weekly: typing.Callable[[], T_Result],
) -> T_Result:
if self is BlobStorageExportFrequency.HOURLY:
return hourly()
if self is BlobStorageExportFrequency.DAILY:
return daily()
if self is BlobStorageExportFrequency.WEEKLY:
return weekly()
def visit(
self,
hourly: typing.Callable[[], T_Result],
daily: typing.Callable[[], T_Result],
weekly: typing.Callable[[], T_Result],
) -> 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 value: {self}")

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