Skip to content

[python] Remove "None" from known values in api_version docstring#10105

Open
Copilot wants to merge 2 commits intomainfrom
copilot/optimize-docstring-api-version
Open

[python] Remove "None" from known values in api_version docstring#10105
Copilot wants to merge 2 commits intomainfrom
copilot/optimize-docstring-api-version

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

Generated Python SDK docstrings for api_version list None as a known value, but the parameter is typed as str and passing None flows through to query serialization rather than falling back to the default.

Before: Known values are "2026-01-01-preview" and None.
After: Known values are "2026-01-01-preview".

  • Skip appending "and None" to the known values string when is_api_version is true in parameter.py's description property
  • Non-api-version optional constant parameters retain existing behavior
Original prompt

This section details on the original issue you should resolve

<issue_title>[python] optimize docstring about api_version in generated SDK</issue_title>
<issue_description>Bot's review comment makes sense Azure/azure-sdk-for-python#45814 (comment):

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

The api_version parameter is typed as `str` and None is not a valid API
version value. Including "None" in the "Known values" list was misleading
as passing api_version=None would flow through to request serialization
rather than falling back to the default.

Before: Known values are "2026-01-01-preview" and None.
After: Known values are "2026-01-01-preview".

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize docstring about api_version in generated SDK [python] Remove "None" from known values in api_version docstring Mar 20, 2026
Copilot AI requested a review from msyyc March 20, 2026 04:12
@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Mar 20, 2026
@msyyc msyyc marked this pull request as ready for review March 20, 2026 05:01
@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[python] optimize docstring about api_version in generated SDK

3 participants