Repository navigation
Commit f848e98
fix(expressions): reject fractional decimal literals on integer columns
DecimalLiteral.to(IntegerType/LongType) rounded the value with
to_integral_value(), so an unquoted filter such as "x > 2.6" on an int
column was bound as x > 3 and silently dropped x = 3; "x < 2.5" became
x < 2 and "x = 2.5" matched x = 2. Raise a ValueError for a value with a
fractional part instead, the same way a Decimal with a mismatched scale is
rejected. Integral values such as 2.00 still convert.
Generated-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 39440e5 commit f848e98
3 files changed
Lines changed: 36 additions & 4 deletions
File tree
- pyiceberg/expressions
- tests
- catalog
- expressions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| |||
527 | 534 | | |
528 | 535 | | |
529 | 536 | | |
530 | | - | |
| 537 | + | |
531 | 538 | | |
532 | 539 | | |
533 | 540 | | |
534 | 541 | | |
535 | 542 | | |
536 | 543 | | |
537 | | - | |
| 544 | + | |
538 | 545 | | |
539 | 546 | | |
540 | | - | |
| 547 | + | |
541 | 548 | | |
542 | 549 | | |
543 | 550 | | |
544 | 551 | | |
545 | 552 | | |
546 | 553 | | |
547 | | - | |
| 554 | + | |
548 | 555 | | |
549 | 556 | | |
550 | 557 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1322 | 1322 | | |
1323 | 1323 | | |
1324 | 1324 | | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
1325 | 1337 | | |
1326 | 1338 | | |
1327 | 1339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
922 | 935 | | |
923 | 936 | | |
924 | 937 | | |
| |||
0 commit comments