Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

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

Important

Add blob storage integration management and organization membership deletion functionalities, update API documentation, and fix minor issues.

  • Blob Storage Integrations:
    • Add BlobStorageIntegrationsClient and AsyncBlobStorageIntegrationsClient in client.py to manage blob storage integrations.
    • Introduce models like BlobStorageIntegrationResponse, CreateBlobStorageIntegrationRequest, and others in types/.
    • Update __init__.py to include new imports for blob storage integrations.
  • Organization Memberships:
    • Add methods delete_organization_membership and delete_project_membership in client.py for managing memberships.
    • Introduce DeleteMembershipRequest and MembershipDeletionResponse models in types/.
    • Update __init__.py to include new imports for organization memberships.
  • Miscellaneous:
    • Update ingestion/client.py to mark the batch ingestion endpoint as legacy.
    • Add session_id parameter to get() in score_v_2/client.py.
    • Update trace/client.py to clarify field inclusion behavior in list() method.
    • Fix import paths in test_http_client.py and test_query_encoding.py.

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

Disclaimer: Experimental PR review

Greptile Summary

Updated On: 2025-09-18 11:26:03 UTC

This PR updates the Langfuse Python API client to match API specification changes from the main langfuse repository (commit 291abf3205462f270d182d068b756bd1add1cd06). The changes introduce significant new functionality for blob storage integrations and expand organization membership management capabilities.

The blob storage integration feature adds a complete CRUD API for managing external storage connections (S3, S3-compatible, Azure Blob Storage) with configurable export frequencies (hourly, daily, weekly), modes (full history, from today, from custom date), and file types (JSON, CSV, JSONL). This includes 8 new API types, a dedicated client with both sync/async implementations, and comprehensive request/response models.

Membership management is enhanced with new DELETE endpoints for removing organization and project memberships, completing the CRUD operations for user access management. The ScoreV2 API gains a new session_id filtering parameter, and the trace list endpoint receives improved documentation for the fields parameter behavior.

Additionally, the ingestion endpoint is marked as legacy with users directed toward the OpenTelemetry endpoint (/api/public/otel), reflecting the platform's migration to industry-standard observability protocols. Documentation URLs are updated from 'tracing-data-model' to 'observability/data-model' to align with this broader repositioning.

All changes follow the established codebase patterns with proper error handling, field aliasing, and Pydantic model configurations. The majority of files are auto-generated by Fern from the API specification, ensuring consistency with the server-side implementation.

Confidence score: 2/5

  • This PR contains critical issues that must be addressed before merging, particularly broken import paths in test files
  • Score lowered due to missing fallback cases in visitor pattern methods and import path errors that will break the test suite
  • Pay close attention to test files with import path changes and enum visitor methods with incomplete implementations

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 +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 fallthrough case in visit method - if an unexpected enum value exists, this will return None instead of raising an error, breaking the return type contract

Suggested change
) -> T_Result:
if self is BlobStorageIntegrationFileType.JSON:
return json()
if self is BlobStorageIntegrationFileType.CSV:
return csv()
if self is BlobStorageIntegrationFileType.JSONL:
return jsonl()
) -> 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 +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 return statement or exception handling - if self doesn't match any of the defined enum values, this method will implicitly return None, violating the return type annotation T_Result

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

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 return statement or exception for unhandled enum values. If self doesn't match any of the three conditions, the method will return None instead of T_Result, violating the type contract.

# This file was auto-generated by Fern from our API Definition.

from langfuse.api.core.query_encoder import encode_query
from langfuse.core.query_encoder import encode_query
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 path appears to be incorrect - langfuse.core.query_encoder does not exist in the repository structure. The original path langfuse.api.core.query_encoder should be used instead.

Suggested change
from langfuse.core.query_encoder import encode_query
from langfuse.api.core.query_encoder import encode_query

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