Skip to content

fix(api): preserve legacy score create alias - #1786

Merged
hassiebp merged 1 commit into
mainfrom
hassiebbot/lfe-10397-score-create-alias
Jul 29, 2026
Merged

fix(api): preserve legacy score create alias#1786
hassiebp merged 1 commit into
mainfrom
hassiebbot/lfe-10397-score-create-alias

fix(api): preserve legacy score create alias

f02e1f0
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 29, 2026 in 14m 28s

Code review found 1 important issue

Found 4 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important scripts/patch_generated_score_compat.py:133-146 _append_type_exports crashes on Fern header-only init.py (no all)
🟡 Nit scripts/patch_generated_score_compat.py:172-194 Compat shim does not patch raw_client.py — with_raw_response.create breaks

Annotations

Check failure on line 146 in scripts/patch_generated_score_compat.py

See this annotation in the file changed.

@claude claude / Claude Code Review

_append_type_exports crashes on Fern header-only __init__.py (no __all__)

_append_type_exports() writes `__all__ = [*__all__, ...]` to legacy/score_v1/__init__.py and legacy/__init__.py with no fallback if `__all__` doesn't already exist, unlike legacy_types_path which has one. Fern emits header-only __init__.py files (no __all__) for packages with zero exported types — confirmed live in this repo at langfuse/api/prompt_version/__init__.py — and since legacy/score_v1/__init__.py currently exports only the three create-related types, it will very likely regenerate into

Check warning on line 194 in scripts/patch_generated_score_compat.py

See this annotation in the file changed.

@claude claude / Claude Code Review

Compat shim does not patch raw_client.py — with_raw_response.create breaks

The postprocessor only patches `legacy/score_v1/client.py`, adding a delegating `create`/`async create`, but never touches `legacy/score_v1/raw_client.py`. Once the coordinated Fern PR removes `create` from the raw clients, `client.legacy.score_v1.with_raw_response.create(...)` will raise `AttributeError` even though the plain `client.legacy.score_v1.create(...)` keeps working. This is a real but narrow gap in legacy API preservation, with no test coverage for `with_raw_response`.