Repository navigation
fix(parameters): honor explicit decimal precision and scale - #988
Open
leninworld wants to merge 1 commit into
Open
leninworld wants to merge 1 commit into
leninworld wants to merge 1 commit into
Conversation
Render declared decimal types in SQL precision,scale order and preserve an explicit zero scale. Correct the parameter descriptions and document the compatibility change for callers that followed the reversed descriptions. Add regression coverage through actual parameter binding, preserving automatic sizing and the string payload. This addresses part of issue databricks#901 only. Validated in Linux aarch64 Docker: 1250 ordinary unit tests and 351 subtests, a separate real-kernel test, formatting, type checks and package builds pass. Four existing tests remain skipped; no live Databricks/e2e tests were run. Signed-off-by: Lenin Mookiah <lenin.world@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses part of issue #901.
What type of PR is this?
Description
Correct the explicit
DecimalParametertype to use SQL'sDECIMAL(precision,scale)order, and honor an explicitly declared zero scale. Correct the parameter descriptions and document the compatibility change for callers who followed the old reversed descriptions. The public signature, validation rules, automatic sizing and value payload are unchanged. Explicit zero precision is now sent as declared instead of silently using automatic sizing.This is a partial fix: it does not change the issue's broader under-declared-scale/truncation semantics or claim that its entire conformance test now passes. The adjacent automatic-sizing work in PR #952 is untouched; its full patch applies cleanly alongside this change.
AI-assisted implementation, independently reviewed. @leninworld personally certified DCO 1.1 and confirmed the commit sign-off.
How is this tested?
Linux aarch64 Docker, Python 3.13.16, Poetry 2.5.1, official optional kernel wheel 1.1.0:
DECIMAL(2,10)andDECIMAL(3,0)); the automatic-sizing control passes.DECIMAL(10,2)andDECIMAL(10,0)for explicit sizes, and preserves automaticDECIMAL(5,2)sizing. Named and positional bindings preserve their string payloads.poetry run python -m pytest tests/unit/test_parameters.py -q poetry run python -m pytest tests/unit -m 'not realkernel' -q -rs poetry run python -m pytest tests/unit/test_session.py -m realkernel -v -rs poetry run black --check src tests/unit/test_parameters.py poetry run mypy --install-types --non-interactive src poetry buildThe four skips are existing upstream markers: two legacy interface cases, an outdated fetch benchmark, and a Thrift native-binding case. Eleven fixture/FutureWarning reports remain. No test, skip marker or warning filter was weakened.
Not run: live Databricks/e2e tests, kernel/SEA SQL-server behavior, other operating systems or the hosted CI matrix. No server-acceptance or performance claim.
Related Tickets & Documents
Refs #901 (explicit precision/scale and zero-scale handling only).