Skip to content

fix(python): Preserve negative decimal values during iteration - #1008

Merged
paleolimbot merged 1 commit into
apache:mainfrom
peterolkhov:codex/preserve-negative-decimal-values
Nov 11, 2026
Merged

paleolimbot merged 1 commit into
apache:mainfrom
peterolkhov:codex/preserve-negative-decimal-values

Conversation

@peterolkhov

Copy link
Copy Markdown
Contributor

Negative decimal128 and decimal256 values become enormous positive values during Python conversion. The stored integer is signed, but _decimal_iter() currently decodes it as unsigned. This adds signed=True at that conversion boundary.

The regression tests cover both widths, negative and positive values, nulls, zero, varied scales and full precision under modified decimal contexts.

Tested with a rebuilt source wheel on macOS arm64/Python 3.14: 276 tests passed, 4 skipped; 118 doctests passed; stubtest passed for eight modules; applicable pre-commit hooks passed. The decimal regressions failed before the change. Other platforms and Python versions remain for CI.

AI assistance: Codex generated the fix and tests and ran the local checks.

@paleolimbot paleolimbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@paleolimbot
paleolimbot merged commit 06a4646 into apache:main Nov 11, 2026
12 checks passed
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.

2 participants