Skip to content

fix: handle bare dict in construct_type - #3458

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

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
Contributor
  • 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

Copy link
Copy Markdown
Contributor

Thank you for the contribution. The missing type arguments for bare dict annotations are now handled in model construction by #3760, which is merged into main.

Closing this PR because the merged change resolves the same crash. Please use a release containing #3760 when available; the fix is not included in v3.11.0.

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)

2 participants