Skip to content

fix: handle bare dict in construct_type#3458

Open
nightcityblade wants to merge 1 commit into
openai:mainfrom
nightcityblade:fix/issue-3341
Open

fix: handle bare dict in construct_type#3458
nightcityblade wants to merge 1 commit into
openai:mainfrom
nightcityblade:fix/issue-3341

Conversation

@nightcityblade

Copy link
Copy Markdown
  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Fixes #3341.

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

Additional context & links

Validation:

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

@nightcityblade nightcityblade requested a review from a team as a code owner June 30, 2026 15:18
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 on bare dict annotation (no type args)

1 participant