Skip to content

[http-client-python] Map numeric scalar to Python float#10563

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-python-emitter-numeric-mapping
Draft

[http-client-python] Map numeric scalar to Python float#10563
Copilot wants to merge 3 commits intomainfrom
copilot/fix-python-emitter-numeric-mapping

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

The Python emitter mapped the TypeSpec numeric scalar to int, truncating floating-point values for operations like:

op nooooooo(): numeric;

Since numeric is the parent of both integer and float scalars, int is unsound — float is the correct Python representation.

Changes

  • packages/http-client-python/emitter/src/types.ts: In sdkScalarKindToPythonKind, change numeric: "integer"numeric: "float".
  • Changeset: Added a fix entry for @typespec/http-client-python.

Copilot AI linked an issue Apr 29, 2026 that may be closed by this pull request
4 tasks
Copilot AI changed the title [WIP] Fix Python emitter numeric mapped to int issue [http-client-python] Map numeric scalar to Python float Apr 29, 2026
Copilot AI requested a review from msyyc April 29, 2026 23:57
@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 Apr 29, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

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

commit: aeefd3f

@github-actions
Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

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

Fix TypeSpec numeric scalar type being emitted as int in Python; it is now emitted as float.

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.

[Bug]: Python Emitter: numeric mapped to int

2 participants