Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

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

Important

Add blob storage integration management and membership management functionalities to the API client.

  • Blob Storage Integrations:
    • Add BlobStorageIntegrationsClient and AsyncBlobStorageIntegrationsClient in client.py to manage blob storage integrations.
    • Introduce methods get_blob_storage_integrations, upsert_blob_storage_integration, and delete_blob_storage_integration.
    • Add types for blob storage integration requests and responses in types/.
  • Membership Management:
    • Add methods in OrganizationsClient and AsyncOrganizationsClient in client.py for managing memberships.
    • Introduce delete_organization_membership and delete_project_membership methods.
    • Add types for membership deletion requests and responses in types/.
  • Miscellaneous:
    • Update API documentation in reference.md.
    • Fix minor issues in test_http_client.py and test_query_encoding.py.

This description was created by Ellipsis for 2da60ed. 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:22:30 UTC

This PR is an auto-generated API specification update that adds comprehensive blob storage integrations functionality and organization membership management features to the Langfuse Python client. The changes synchronize the Python SDK with API updates from the main Langfuse repository (commit d7069df433ba218bff7cea0739edbfa01ffe3413).

Key Additions:

  1. Blob Storage Integrations: Complete CRUD API for managing blob storage integrations (S3, S3-compatible, Azure Blob Storage) with configurable export frequencies (hourly/daily/weekly), export modes (full history, from today, from custom date), and file formats (JSON/CSV/JSONL). This enables automated data exports to external storage.

  2. Organization Membership Deletion: New API endpoints for deleting organization and project memberships, completing the CRUD interface that previously only supported creation and updates.

  3. Enhanced Score Filtering: Added session_id parameter to the scores v2 API, allowing users to filter scores by specific sessions.

  4. API Migration Guidance: Updated ingestion endpoint documentation to mark it as legacy and direct users to the preferred OpenTelemetry endpoint.

  5. Improved Documentation: Enhanced trace listing API documentation with clearer field parameter descriptions and behavior explanations.

The changes follow established patterns in the codebase with proper Pydantic models, comprehensive error handling, type annotations, and consistent serialization methods. All new functionality includes both synchronous and asynchronous client implementations.

Confidence score: 2/5

  • This PR contains multiple critical bugs in auto-generated visitor pattern implementations that could cause runtime failures
  • Score reflects serious implementation flaws in several enumeration files where visitor methods lack proper fallback handling
  • Pay close attention to BlobStorageExportFrequency, BlobStorageExportMode, BlobStorageIntegrationFileType, and BlobStorageIntegrationType enum files

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 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 a new enum value is added, this method will implicitly return None instead of raising an error

Suggested change
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()
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 +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 the case where self doesn't match any of the defined enum values. This could return None implicitly, violating the T_Result return type annotation. Consider adding a final else clause that raises an exception.

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 enum value: {self}")

Comment on lines +14 to +25
def visit(
self,
s_3: typing.Callable[[], T_Result],
s_3_compatible: typing.Callable[[], T_Result],
azure_blob_storage: typing.Callable[[], T_Result],
) -> 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 return statement or exception handling for unmatched enum values. If an invalid enum value exists, this method will implicitly return None instead of T_Result, violating the type contract.

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

Comment on lines +3 to +4
from langfuse.core.http_client import get_request_body
from langfuse.core.request_options import RequestOptions
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: These import paths appear to reference non-existent modules. The repository structure shows 'langfuse/api/core/' but not 'langfuse/core/'. This will cause ImportError at runtime.

Suggested change
from langfuse.core.http_client import get_request_body
from langfuse.core.request_options import RequestOptions
from langfuse.api.core.http_client import get_request_body
from langfuse.api.core.request_options import RequestOptions

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