Skip to content

Preserve Decimal values as numeric literals in client-side binding - #3036

Open
Shubham-Padkonde wants to merge 5 commits into
snowflakedb:mainfrom
Shubham-Padkonde:fix/decimal-client-side-binding
Open

Shubham-Padkonde wants to merge 5 commits into
snowflakedb:mainfrom
Shubham-Padkonde:fix/decimal-client-side-binding

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown
  1. Issue: Fixes SNOW-2248950: converter.py: parameter binding for decimal.Decimal produces incorrect SQL #2455.

  2. Pre-review checklist:

  • New automated tests
  • New logging messages
  • New telemetry messages
  • Authorization changes
  • New credentials
  • OCSP changes
  • New dependency
  1. Finite Decimal parameters were converted to strings and then quoted, so Decimal('1.3') produced a string literal. Preserve finite Decimal values until quoting and use their exact decimal representation, without converting through float. Keep non-finite values quoted and server-side binding unchanged. Includes mixed-list, precision, scale, negative-zero and special-value tests plus release notes.

Validation: six regression cases fail before the fix; all 38 converter tests pass afterward. Black, isort and flake8 checks passed. No live Snowflake integration tests were run.

Prepared with Codex assistance.

@Shubham-Padkonde

Copy link
Copy Markdown
Author

Merged current main and resolved the release-note conflict by keeping the Decimal binding fix under the current unreleased section alongside the upstream entries. All 38 converter tests pass on Windows/Python 3.13 (pytest test/unit/test_converter.py --noconftest); this isolated converter run omits the integration fixtures and reports three missing-plugin configuration warnings. No live Snowflake tests were run. git diff --check passes. Prepared with Codex assistance.

This branch has not been deployed

No deployments
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.

SNOW-2248950: converter.py: parameter binding for decimal.Decimal produces incorrect SQL

1 participant