-
Notifications
You must be signed in to change notification settings - Fork 0
release: 4.1.0 #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
release: 4.1.0 #62
Conversation
6c2b6c5 to
a594c75
Compare
85e4dfe to
1322c80
Compare
2bb4c49 to
7e69125
Compare
7cdfb0a to
ca310cd
Compare
fix(client): mark some request bodies as optional
3bdb00f to
3ad7f25
Compare
1be6ce9 to
97b7254
Compare
35a4088 to
bc25b84
Compare
ef0d130 to
08062c4
Compare
9257acd to
b41543a
Compare
df1d708 to
69a44e3
Compare
cf36bae to
bba1424
Compare
e0b03f0 to
3d90dff
Compare
84a0625 to
db19786
Compare
359644d to
21a20b3
Compare
68d28dd to
873e0de
Compare
873e0de to
9ef228a
Compare
9ef228a to
e4ed00c
Compare
e4ed00c to
a72636d
Compare
a72636d to
b7b5b98
Compare
b7b5b98 to
f7c66f3
Compare
| if metadata is not None and len(metadata) > 0: | ||
| meta: tuple[Any, ...] = tuple(metadata) | ||
| elif is_annotated_type(type_): | ||
| meta = get_args(type_)[1:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Annotated types not unwrapped when metadata provided directly
The construct_type function has a bug where Annotated types are not unwrapped when metadata is provided directly. The comment says "unwrap Annotated[T, ...] -> T" but when the first branch is taken (metadata non-empty), type_ remains wrapped as Annotated[T, ...]. This causes get_origin(type_) to return Annotated, which doesn't match any type handlers (list, dict, BaseModel, etc.), so nested types like Annotated[list[MyModel], PropertyInfo(...)] won't have their items properly constructed. The elif is_annotated_type(type_) branch that unwraps the type is skipped when metadata is provided.
Additional Locations (1)
f7c66f3 to
f0262a9
Compare
| else: | ||
| import types | ||
|
|
||
| return tp is Union or tp is types.UnionType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: is_union fails to recognize parameterized union types
The is_union function checks tp is Union directly, but parameterized unions like Union[A, B] are not the same object as Union. The old Pydantic v1 implementation used get_origin(tp) is Union, which correctly handled parameterized unions. This causes is_basemodel to fail recognizing union types containing BaseModel classes, since is_union(Union[ModelA, ModelB]) incorrectly returns False. This affects response parsing when the cast_to type is a union of models.
Additional Locations (1)
f0262a9 to
3524f04
Compare
3524f04 to
9bd1046
Compare
9bd1046 to
f263f8c
Compare
f263f8c to
5cddd6f
Compare
5cddd6f to
590d7c8
Compare
Automated Release PR
4.1.0 (2025-12-19)
Full Changelog: v4.0.0...v4.1.0
Features
NotGivenfor body (#67) (3ad7f25)X-Stainless-Read-Timeoutheader (#63) (a594c75)Bug Fixes
model_dumpandmodel_dump_jsonfor Pydantic v1 (898ca7b)Chores
httpx-aiohttpversion to 0.1.9 (7aeb4c8)--fixargument to lint script (0b1e68e)pyproject.tomlfile (f87b268)get_platformtest (ef07d85)Documentation
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions
Note
Release 4.1.0 with aiohttp support, follow_redirects, API/type updates (voice deployments, Omit), CI/dev tooling upgrades, and docs refinements.
DefaultAioHttpClient(aiohttp backend) and per-requestfollow_redirects.X-Stainless-Read-Timeout; improve retries (loop + sleep), pagination (PageInfosupportsjson), and content-type/binary handling.omit/not_given; enhance file upload (patch/put), platform/proxy handling, and streaming cleanup.VoiceDeployment; update return types and list aliasing.Omitfor optional params across workers/flows; updateapi.mdaccordingly.aiohttpextra, newer classifiers (3.13/3.14), dev deps pins; ruff/mypy/pytest settings; lockfiles refreshed.Written by Cursor Bugbot for commit 590d7c8. This will update automatically on new commits. Configure here.