Skip to content

feat(api): update API spec from langfuse/langfuse 6191e50#1736

Open
langfuse-bot wants to merge 1 commit into
mainfrom
api-spec-bot-6191e50
Open

feat(api): update API spec from langfuse/langfuse 6191e50#1736
langfuse-bot wants to merge 1 commit into
mainfrom
api-spec-bot-6191e50

Conversation

@langfuse-bot

@langfuse-bot langfuse-bot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

This is an automated API spec sync from the upstream langfuse/langfuse repository (commit 6191e50), generated via Fern. It adds a new dashboard_widgets sub-client under the unstable namespace, introduces a BlobStorageIntegrationFileTypeResponse enum that exposes the PARQUET file type (which can be set via the UI but not yet via the API), and extends BlobStorageSyncStatus with a new RUNNING value.

  • New unstable/dashboard_widgets module: Adds RawDashboardWidgetsClient / AsyncRawDashboardWidgetsClient and their thin-wrapper counterparts, exposing a single POST /api/public/unstable/dashboard-widgets endpoint; nine supporting type models are also added.
  • BlobStorageIntegrationFileTypeResponse: New response-only enum separating the read-only PARQUET value from the writable BlobStorageIntegrationFileType, and BlobStorageIntegrationResponse.file_type is updated to use it.
  • BlobStorageSyncStatus.RUNNING: New enum value added with doc-comment update; export_start_date gains a constraint note about future-date validation.

Confidence Score: 4/5

The changes are auto-generated from the upstream API spec and are purely additive — new module, new enum values, doc updates — with no existing behaviour removed or broken.

All findings are style/quality observations in Fern-generated code: lazy imports that violate the project's import rule, and unreachable duplicate error handlers inherited from the existing generation pattern. The BlobStorageIntegrationResponse.file_type type change from BlobStorageIntegrationFileType to BlobStorageIntegrationFileTypeResponse is a type-level change for a response model, unlikely to affect callers in practice.

langfuse/api/unstable/dashboard_widgets/raw_client.py — contains the duplicate error-handler blocks; langfuse/api/unstable/client.py — contains the lazy sub-module imports inside property bodies

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Caller
    participant DashboardWidgetsClient
    participant RawDashboardWidgetsClient
    participant LangfuseAPI as Langfuse API

    Caller->>DashboardWidgetsClient: create(name, view, dimensions, metrics, filters, chart_type, chart_config)
    DashboardWidgetsClient->>RawDashboardWidgetsClient: create(...)
    RawDashboardWidgetsClient->>LangfuseAPI: POST /api/public/unstable/dashboard-widgets
    LangfuseAPI-->>RawDashboardWidgetsClient: 200 DashboardWidget JSON
    alt 400 Bad Request
        LangfuseAPI-->>RawDashboardWidgetsClient: BadRequestError (PublicApiError)
    else 401 Unauthorized
        LangfuseAPI-->>RawDashboardWidgetsClient: UnauthorizedError
    else 403 Forbidden
        LangfuseAPI-->>RawDashboardWidgetsClient: AccessDeniedError
    else 429 Rate Limited
        LangfuseAPI-->>RawDashboardWidgetsClient: TooManyRequestsError
    else 500 Internal Server Error
        LangfuseAPI-->>RawDashboardWidgetsClient: InternalServerError
    end
    RawDashboardWidgetsClient-->>DashboardWidgetsClient: HttpResponse[DashboardWidget]
    DashboardWidgetsClient-->>Caller: DashboardWidget
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Caller
    participant DashboardWidgetsClient
    participant RawDashboardWidgetsClient
    participant LangfuseAPI as Langfuse API

    Caller->>DashboardWidgetsClient: create(name, view, dimensions, metrics, filters, chart_type, chart_config)
    DashboardWidgetsClient->>RawDashboardWidgetsClient: create(...)
    RawDashboardWidgetsClient->>LangfuseAPI: POST /api/public/unstable/dashboard-widgets
    LangfuseAPI-->>RawDashboardWidgetsClient: 200 DashboardWidget JSON
    alt 400 Bad Request
        LangfuseAPI-->>RawDashboardWidgetsClient: BadRequestError (PublicApiError)
    else 401 Unauthorized
        LangfuseAPI-->>RawDashboardWidgetsClient: UnauthorizedError
    else 403 Forbidden
        LangfuseAPI-->>RawDashboardWidgetsClient: AccessDeniedError
    else 429 Rate Limited
        LangfuseAPI-->>RawDashboardWidgetsClient: TooManyRequestsError
    else 500 Internal Server Error
        LangfuseAPI-->>RawDashboardWidgetsClient: InternalServerError
    end
    RawDashboardWidgetsClient-->>DashboardWidgetsClient: HttpResponse[DashboardWidget]
    DashboardWidgetsClient-->>Caller: DashboardWidget
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
langfuse/api/unstable/client.py:42-49
**Lazy imports inside property bodies violate the module-level import rule**

The `from .dashboard_widgets.client import DashboardWidgetsClient` and `from .dashboard_widgets.client import AsyncDashboardWidgetsClient` statements are placed inside the property method bodies. The same pattern is present in the existing `evaluation_rules` and `evaluators` properties (lines 52–60 and 67–75). All sub-client imports should be moved to the top of the module (or to the existing `if typing.TYPE_CHECKING` block for the type references, with a runtime top-level import) instead of being deferred inside methods.

### Issue 2 of 2
langfuse/api/unstable/dashboard_widgets/raw_client.py:993-1047
**Dead-code duplicate error handlers for 400/401/403/405**

The first block (lines 927–992) already raises typed exceptions for status codes 400, 401, 403, and 405 before this second block is reached, so the four corresponding `if _response.status_code == ...` checks here can never execute. Only the `404 → NotFoundError` branch is reachable. The same pattern appears in `AsyncRawDashboardWidgetsClient.create` as well. This is a Fern code-generation artefact that matches the pre-existing pattern in `evaluation_rules/raw_client.py`, but the unreachable handlers using `typing.Any` bodies mean any future refactoring that swaps the first block's order would silently change which exception type is raised for those status codes.

Reviews (1): Last reviewed commit: "feat(api): update API spec from langfuse..." | Re-trigger Greptile

Context used:

  • Rule used - Move imports to the top of the module instead of p... (source)

Learned From
langfuse/langfuse-python#1387

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto-generated Fern SDK update mirroring the API spec — new dashboard_widgets unstable client, additive enum values (PARQUET file type, RUNNING sync status), and docstring clarifications.

Extended reasoning...

Overview

This PR is a fully auto-generated Fern SDK regeneration from the upstream API definition (every touched file carries the "auto-generated by Fern" header). Changes are purely additive: a new BlobStorageIntegrationFileTypeResponse enum that adds PARQUET, a new RUNNING value on BlobStorageSyncStatus, docstring updates noting the 27-hour exportStartDate tolerance, and a brand-new unstable.dashboard_widgets subclient with its associated request/response types.

Security risks

None. These are typed HTTP client bindings with no auth, crypto, or input-handling logic. The generator emits standard httpx request/response code identical in shape to the rest of the SDK.

Level of scrutiny

Low. This is a mechanical codegen update touching only langfuse/api/ (auto-generated surface), with no changes to hand-written SDK code, tracing, or ingestion. Additive enum members are backwards-compatible for consumers, and the new dashboard-widgets client is opt-in under the unstable namespace.

Other factors

The bug hunting system found no issues. The response-side enum split (BlobStorageIntegrationFileTypeResponse distinct from the request BlobStorageIntegrationFileType) is deliberate — the docstring explicitly notes PARQUET is UI-settable but not API-settable, which is the exact reason to separate response from request types.

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.

1 participant