Skip to content

fix: handle bare container types#1659

Open
ynachiket wants to merge 1 commit into
anthropics:mainfrom
ynachiket:ynachiket/handle-bare-container-types-1626-1628
Open

fix: handle bare container types#1659
ynachiket wants to merge 1 commit into
anthropics:mainfrom
ynachiket:ynachiket/handle-bare-container-types-1626-1628

Conversation

@ynachiket

Copy link
Copy Markdown

Fixes #1619.
Fixes #1626.
Fixes #1628.

Summary

  • treat bare dict and list annotations as untyped containers in construct_type instead of indexing missing type args
  • treat bare dict annotations as untyped in sync and async transform paths
  • add focused regression coverage for the reported bare-container crashes

Testing

  • PYTHONPATH=src /tmp/anthropic-pdlc042-venv/bin/python -m pytest tests/test_models.py::test_construct_type_bare_container_types tests/test_transform.py::test_bare_dict_type -q (3 passed)
  • PYTHONPATH=src /tmp/anthropic-pdlc042-venv/bin/python -m pytest tests/test_models.py tests/test_transform.py -q (117 passed)
  • PYTHONPATH=src /tmp/anthropic-pdlc042-venv/bin/python -m py_compile src/anthropic/_models.py src/anthropic/_utils/_transform.py tests/test_models.py tests/test_transform.py
  • git diff --check

@ynachiket ynachiket requested a review from a team as a code owner June 6, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant