Skip to content

[typespec-python] Regenerate tests from microsoft/typespec PR #11233 - #48040

Merged
Yuchao Yan (msyyc) merged 1 commit into
typespec-python-generated-testsfrom
regen/typespec-python-pr-11233
Jul 16, 2026
Merged

Yuchao Yan (msyyc) merged 1 commit into
typespec-python-generated-testsfrom
regen/typespec-python-pr-11233

Conversation

@msyyc

Copy link
Copy Markdown
Member

NOTE: This PR exists only to display the code diff. Please do not merge it.

Fixes #48039

Source: microsoft/typespec#11233

Automated regeneration of TypeSpec Python generated tests from microsoft/typespec PR #11233.

This PR was auto-generated. Re-run the workflow to update it after new commits are pushed to the upstream TypeSpec PR

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions
github-actions Bot force-pushed the regen/typespec-python-pr-11233 branch from 71fea71 to d6cf545 Compare July 15, 2026 08:31
"""

@distributed_trace_async
async def default(self, value: Union[bytes, IO[bytes]], **kwargs: Any) -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this also have content_type?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually set content_type in code but do not show it in signatures. It is legacy behavior and I keep same as before.

@msyyc
Yuchao Yan (msyyc) marked this pull request as ready for review July 16, 2026 03:06
@msyyc Yuchao Yan (msyyc) changed the title [typespec-python] Regenerate tests from microsoft/typespec PR #11233 (DO NOT MERGE) [typespec-python] Regenerate tests from microsoft/typespec PR #11233 Jul 16, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@msyyc
Yuchao Yan (msyyc) merged commit 92a4e2a into typespec-python-generated-tests Jul 16, 2026
2 checks passed
@msyyc
Yuchao Yan (msyyc) deleted the regen/typespec-python-pr-11233 branch July 16, 2026 03:07
Wei Hu (live1206) pushed a commit to live1206/typespec that referenced this pull request Jul 16, 2026
## Design
design is approved in [teams
channel](https://teams.microsoft.com/l/message/19:676a24a78b2247d091a259a1d3f88bc2@thread.v2/1783588388853?context=%7B%22contextType%22%3A%22chat%22%7D)

## Summary
Add an `IO[bytes]` overload alongside `bytes` for binary `bytes` bodies
in the Python emitter, to keep backward compatibility for services
migrating from swagger (whose binary bodies were typed as `IO`).

- [x] Add IO overload for binary `bytes` bodies in preprocess
(`add_body_param_type`)
- [x] Fix body serialization to avoid redundant/mypy-breaking isinstance
branch when both overloads write raw content
- [x] Describe `bytes` overload content-type param as "byte" body
- [x] Add unit tests (`test_bytes_body_overloads.py`) — passing
- [x] Add mock_api tests exercising the IO overload (sync + async)
- [x] Regenerate all specs; encode-bytes & streaming-jsonl verified
(mypy assignment error resolved)
- [x] Full typecheck:generated run (was in progress at timeout)
- [x] Add changelog entry (chronus)

## Code diff
 Azure/azure-sdk-for-python#48040

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
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.

2 participants