Skip to content

fix: handle bare dict in construct_type#1720

Open
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1619
Open

fix: handle bare dict in construct_type#1720
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1619

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #1619

Treat bare dict annotations as an untyped mapping in construct_type() instead of unpacking missing type arguments. Adds a focused regression test for construct_type(value={...}, type_=dict).

Validation:

  • uv run pytest tests/test_models.py -k bare_dict
  • uv run ruff check src/anthropic/_models.py tests/test_models.py

@nightcityblade nightcityblade requested a review from a team as a code owner June 30, 2026 15:14
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.

BUG: construct_type() crashes with ValueError when type_ is a bare dict

1 participant