Repository navigation
[python] fix casing enum - #10329
[python] fix casing enum#10329
Conversation
commit: |
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
|
Yuchao Yan (@msyyc) I definitely will investigate this more. I think overall I like the new casing for enums better, but I'm going to go through the rest api specs repo to see how many specs would be affected. Also regardless, I think we need some kind of decorator in tcgc that is like "this is the exact client name, don't change casing or anything", what are your thgouths Chenjie Shi (@tadelesh). Something like |
We had a issue to track this: Azure/typespec-azure#3607. Let's prioritize it. I don't think we need a new decorator. We could just add a flag to tell if the name has been customized. |
|
Hi @iscai-msft. Your PR has had no update for 30 days and it is marked as a stale PR. If it is not updated within 30 days, the PR will automatically be closed. If you want to refresh the PR, please remove the |
|
Hi @iscai-msft. The PR will be closed since the PR has no update for 28 days. If this is still relevant please reopen. |
Preserve enum casing changes and current utility regression tests. Co-authored-by: Copilot App <[email protected]> Copilot-Session: a56d520e-33f1-474a-aa6c-7f8d999656d8
Python emitter diffBaseline No changes to generated output. Rendered diff: inline on the run summary, or the emitter-diff-html artifact. Informational check (eng/emitter-diff); does not block the PR. |
Keep digits attached to preceding words and restore word boundaries after digits while preserving date separators and short alphanumeric acronyms. Co-authored-by: Copilot App <[email protected]> Copilot-Session: a56d520e-33f1-474a-aa6c-7f8d999656d8
There was a problem hiding this comment.
🟡 Changes recommended
The shared conversion still introduces unintended underscores in plural-acronym numeric names, changing existing generated Python properties.
1 open issue
What changed in this PR
This PR addresses #10312 by updating Python emitter name conversion to preserve underscores before date segments and keep acronyms such as A2A intact.
Changes:
- Adjusts numeric boundary handling in the shared naming utility.
- Adds utility and emitter tests for enum members and numeric property names.
- Adds a Python emitter changelog entry.
| File | Description |
|---|---|
| packages/http-client-python/emitter/test/utils.test.ts | Adds numeric boundary and acronym conversion cases. |
| packages/http-client-python/emitter/test/emitter.test.ts | Checks emitted enum and property names. |
| packages/http-client-python/emitter/src/utils.ts | Revises digit splitting and preserves numeric separators. |
| .chronus/changes/python-fixCasingEnum-2026-3-9-16-6-39.md | Documents the naming fix. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
I expect this PR may introduce some breaking changes to enum names, but I believe the improvement is worthwhile because the new enum member name is clearer. To mitigate the impact on legacy enum cases, I will use clientName and exact. |

fixes #10312