feat(api): update API spec from langfuse/langfuse 7c46d98#1744
feat(api): update API spec from langfuse/langfuse 7c46d98#1744langfuse-bot wants to merge 1 commit into
Conversation
|
@claude review |
| def visit( | ||
| self, | ||
| json: typing.Callable[[], T_Result], | ||
| csv: typing.Callable[[], T_Result], | ||
| jsonl: typing.Callable[[], T_Result], | ||
| parquet: 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() | ||
| if self is BlobStorageIntegrationFileType.PARQUET: | ||
| return parquet() |
There was a problem hiding this comment.
Breaking change:
parquet is now a required parameter in visit()
Adding parquet as a required positional argument means any existing caller of BlobStorageIntegrationFileType.visit() that passes only json, csv, and jsonl will now raise a TypeError at runtime. Since PARQUET did not previously exist in this enum (only in BlobStorageIntegrationFileTypeResponse), all current callers of this method will be broken by this change without a corresponding update on their side.
Prompt To Fix With AI
This is a comment left during a code review.
Path: langfuse/api/blob_storage_integrations/types/blob_storage_integration_file_type.py
Line: 20-34
Comment:
**Breaking change: `parquet` is now a required parameter in `visit()`**
Adding `parquet` as a required positional argument means any existing caller of `BlobStorageIntegrationFileType.visit()` that passes only `json`, `csv`, and `jsonl` will now raise a `TypeError` at runtime. Since `PARQUET` did not previously exist in this enum (only in `BlobStorageIntegrationFileTypeResponse`), all current callers of this method will be broken by this change without a corresponding update on their side.
How can I resolve this? If you propose a fix, please make it concise.| ) -> T_Result: | ||
| if self is BlobStorageIntegrationFileType.JSON: | ||
| return json() | ||
| if self is BlobStorageIntegrationFileType.CSV: | ||
| return csv() | ||
| if self is BlobStorageIntegrationFileType.JSONL: | ||
| return jsonl() | ||
| if self is BlobStorageIntegrationFileType.PARQUET: | ||
| return parquet() |
There was a problem hiding this comment.
visit() returns None implicitly when no branch matches
The method has no final else/raise clause. If self ever holds a value not covered by the if checks — e.g. a future enum member added to the spec before the visit signature is updated — the function falls through and implicitly returns None, silently violating the T_Result return type. Adding raise ValueError(f"Unknown BlobStorageIntegrationFileType: {self}") as a trailing guard would surface this immediately instead of propagating a None into caller logic.
Prompt To Fix With AI
This is a comment left during a code review.
Path: langfuse/api/blob_storage_integrations/types/blob_storage_integration_file_type.py
Line: 26-34
Comment:
**`visit()` returns `None` implicitly when no branch matches**
The method has no final `else`/`raise` clause. If `self` ever holds a value not covered by the `if` checks — e.g. a future enum member added to the spec before the `visit` signature is updated — the function falls through and implicitly returns `None`, silently violating the `T_Result` return type. Adding `raise ValueError(f"Unknown BlobStorageIntegrationFileType: {self}")` as a trailing guard would surface this immediately instead of propagating a `None` into caller logic.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Auto-generated API spec update adding PARQUET to the request-side file type enum.
Extended reasoning...
Overview
This PR is an auto-generated API client update from the langfuse/langfuse OpenAPI spec (commit 7c46d98). It adds PARQUET as a new variant to BlobStorageIntegrationFileType (the request-side enum), including a corresponding parquet callback in the visit() method, and updates docstrings on both request- and response-side enums to reflect that PARQUET is now settable via the API.
Security risks
None. These are pure enum additions in auto-generated client type files with no logic changes, no auth, and no network handling.
Level of scrutiny
Low. The files carry the # This file was auto-generated by Fern from our API Definition. header, and the changes are mechanical: one new enum member and one new visitor callback parameter, mirrored across the two files consistently. This aligns with prior auto-gen update PRs in the repo history.
Other factors
The visit() signature gains a required parquet callback, which is technically a breaking change for any external caller directly invoking visit() — but this is standard for Fern-generated visitors on enum additions and is the intended pattern. No caller in this repo uses visit() on these types.
Greptile Summary
This auto-generated PR (from the Fern API spec at
langfuse/langfuse@7c46d98) promotesPARQUETfrom a response-only file type to a fully supported request file type for blob storage integrations, and updates the docstrings accordingly.BlobStorageIntegrationFileTypegains thePARQUETenum member and a new requiredparquetcallback invisit(), along with a docstring describing Parquet-specific constraints (no gzip, missing price columns in observation exports).BlobStorageIntegrationFileTypeResponsehas its docstring simplified — the previous caveat that PARQUET could not be set via the API is removed, since it is now settable on the request side.Confidence Score: 4/5
Safe to merge for the API spec sync itself; callers using
BlobStorageIntegrationFileType.visit()must add the newparquetargument before upgrading.Adding
parquetas a required parameter toBlobStorageIntegrationFileType.visit()is a breaking change for any existing caller of that method, sincePARQUETwas not previously a member of that enum. All call sites that pass onlyjson,csv, andjsonlwill raise aTypeErrorat runtime without a corresponding code update. TheBlobStorageIntegrationFileTypeResponsechange is documentation-only and carries no risk.langfuse/api/blob_storage_integrations/types/blob_storage_integration_file_type.py — the new required
parquetparameter invisit()will break existing callers.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["visit called with json, csv, jsonl, parquet callbacks"] --> B{self is JSON?} B -->|Yes| C["return json()"] B -->|No| D{self is CSV?} D -->|Yes| E["return csv()"] D -->|No| F{self is JSONL?} F -->|Yes| G["return jsonl()"] F -->|No| H{self is PARQUET?} H -->|Yes| I["return parquet()"] H -->|No| J["implicit return None - no fallback raise"] style J fill:#ffcccc%%{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"}}}%% flowchart TD A["visit called with json, csv, jsonl, parquet callbacks"] --> B{self is JSON?} B -->|Yes| C["return json()"] B -->|No| D{self is CSV?} D -->|Yes| E["return csv()"] D -->|No| F{self is JSONL?} F -->|Yes| G["return jsonl()"] F -->|No| H{self is PARQUET?} H -->|Yes| I["return parquet()"] H -->|No| J["implicit return None - no fallback raise"] style J fill:#ffccccPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat(api): update API spec from langfuse..." | Re-trigger Greptile