Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

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

Important

This PR adds new clients and methods for managing blob storage integrations and organization memberships, updates API documentation, and includes test updates.

  • 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 requests and responses in types/.
  • Organization Memberships:
    • Added methods delete_organization_membership and delete_project_membership in organizations/client.py.
    • Introduced DeleteMembershipRequest and MembershipDeletionResponse types.
  • API Documentation:
    • Updated reference.md with new methods and descriptions for blob storage integrations and memberships.
    • Updated legacy endpoint descriptions in ingestion/client.py.
  • Miscellaneous:
    • Fixed typo in README.md.
    • Updated test files test_http_client.py and test_query_encoding.py for new functionality.

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

Disclaimer: Experimental PR review

Greptile Summary

Updated On: 2025-09-18 09:15:03 UTC

This PR is an auto-generated API specification update from the main Langfuse repository that introduces significant new functionality and makes structural improvements. The changes primarily add blob storage integration capabilities and enhance organization membership management.

Key additions:

  • Blob Storage Integrations: Complete CRUD operations for managing external storage backends (S3, S3-compatible services, Azure Blob Storage) with support for different export frequencies, modes, and file types
  • Organization Membership Management: New delete operations for removing users from organizations and projects
  • API Enhancements: Added session-based filtering for scores and improved field filtering documentation for traces
  • API Deprecation Guidance: Marked batch ingestion endpoint as legacy with clear migration path to OpenTelemetry

The blob storage functionality enables automated data export with flexible scheduling and configuration options. All new models follow established Pydantic patterns with proper field aliasing, serialization methods, and immutable configurations. The changes include both synchronous and asynchronous client implementations, maintaining consistency with the existing codebase architecture.

Additionally, the PR updates test imports to reflect a module restructuring from langfuse.api.core to langfuse.core, suggesting a broader reorganization of core utilities.

Confidence score: 2/5

  • This PR introduces significant new functionality but contains multiple critical bugs in auto-generated enum visitor methods that could cause runtime failures
  • Score reflects concerns about incomplete visitor pattern implementations in blob storage enum files and potentially broken import paths in test files
  • Pay close attention to blob storage enum files (blob_storage_export_mode.py, blob_storage_integration_type.py, blob_storage_export_frequency.py, blob_storage_integration_file_type.py) and test files with updated import paths

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

Edit Code Review Bot Settings | Greptile

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: The visit method is missing a fallback return statement or exception handling. If self doesn't match any of the enum values, the method will implicitly return None, violating the T_Result return type annotation.

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: The visit method is missing a fallback case - if self doesn't match any of the three enum values, the method will implicitly return None, violating the T_Result return type annotation. Add a final raise ValueError(f'Unknown BlobStorageIntegrationType: {self}') or similar exception handling.

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 +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: The visit method lacks a default case or explicit error handling. If self doesn't match any of the enum values (which theoretically shouldn't happen), the method will implicitly return None instead of T_Result, violating the type annotation.

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: The visit method is missing a return statement or error handling for cases where self doesn't match any of the defined enum values. This could cause the method to return None implicitly, leading to runtime errors.

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: Import paths changed from langfuse.api.core to langfuse.core but the target modules don't appear to exist in the repository structure. 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