Skip to content

[python] remove reserved word padding for enum values#9898

Merged
msyyc merged 3 commits intomainfrom
copilot/fix-ci-failures-http-client
Mar 6, 2026
Merged

[python] remove reserved word padding for enum values#9898
msyyc merged 3 commits intomainfrom
copilot/fix-ci-failures-http-client

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Enum values are generated in UPPER_CASE, so reserved word padding is unnecessary. Removes PadType.ENUM_VALUE and its associated logic.

  • python_mappings.py: Remove ENUM_VALUE variant from PadType enum and its entry in RESERVED_WORDS
  • preprocess/__init__.py: Drop update_enum_value import; replace padding logic with direct str.upper() (retaining ENUM_ prefix for digit-leading names)
  • test_name_converter.py: Remove ENUM_VALUE test cases that referenced the deleted variant (CI fix)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Enum values are generated in UPPER_CASE so there is no need for reserved
word padding. This removes PadType.ENUM_VALUE and its associated logic,
and fixes the failing test_escaped_reserved_words test.

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
@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 4, 2026
Copilot AI changed the title [WIP] Fix CI failures in HTTP client tests [python] remove reserved word padding for enum values Mar 4, 2026
Copilot finished work on behalf of msyyc March 4, 2026 05:37
@msyyc msyyc marked this pull request as ready for review March 4, 2026 06:10
@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@msyyc msyyc enabled auto-merge March 4, 2026 08:27
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 6, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@9898

commit: cc4499d

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - feature ✏️

Remove enum value padding because we generate our enum value names with upper case so there is no need

@msyyc msyyc added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit 8e7112f Mar 6, 2026
26 checks passed
@msyyc msyyc deleted the copilot/fix-ci-failures-http-client branch March 6, 2026 03:43
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.

4 participants