fix(rust,python): Schema inconsistent on Decimal arithmetic with integer - #28819
Open
BhargavKumarNath wants to merge 5 commits into
Open
fix(rust,python): Schema inconsistent on Decimal arithmetic with integer#28819BhargavKumarNath wants to merge 5 commits into
BhargavKumarNath wants to merge 5 commits into
Conversation
BhargavKumarNath
requested review from
MarcoGorelli,
alexander-beedie,
c-peters,
orlp and
ritchie46
as code owners
August 14, 2026 13:55
BhargavKumarNath
force-pushed
the
fix-decimal-schema-28654
branch
from
August 14, 2026 14:06
ccbfdde to
c2e2650
Compare
BhargavKumarNath
force-pushed
the
fix-decimal-schema-28654
branch
from
August 14, 2026 14:08
c2e2650 to
39b65b2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28819 +/- ##
==========================================
+ Coverage 81.51% 81.56% +0.04%
==========================================
Files 1888 1888
Lines 266924 267749 +825
Branches 3240 3240
==========================================
+ Hits 217594 218399 +805
- Misses 48502 48522 +20
Partials 828 828 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Author
|
Fix complete. All checks passed |
BhargavKumarNath
force-pushed
the
fix-decimal-schema-28654
branch
from
August 18, 2026 10:36
50174e2 to
c297a09
Compare
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.
Fixes a schema inconsistency where operations between a Decimal and an integer would preserve the original decimal precision during lazy schema inference (e.g. Decimal(10, 2)), while the actual physical runtime correctly operates using maximum precision Decimal(38, 2) (DEC128_MAX_PREC).
This PR updates schema.rs to explicitly handle Decimal op integer across +, -, *, and /, ensuring get_arithmetic_field and get_truediv_field correctly return Decimal(DEC128_MAX_PREC, scale) to match the eager runtime schema.
Tests Added a parametric test suite in test_arithmetic.py that verifies collect_schema() matches collect().schema for Decimal interactions against all 9 integer types (Int8 through Int128, UInt8 through UInt64) and basic operators.
I used AI to design the test suites.
I confirm that I have reviewed all changes myself, and I believe they are relevant and correct.