Repository navigation
Commit c4489d7
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 <[email protected]>1 parent 068aae5 commit c4489d7
3 files changed
Lines changed: 40 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 | |
|---|---|---|---|
| |||
1345 | 1345 | | |
1346 | 1346 | | |
1347 | 1347 | | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
1348 | 1362 | | |
1349 | 1363 | | |
1350 | 1364 | | |
| |||
| 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 | + | |
| 935 | + | |
| 936 | + | |
922 | 937 | | |
923 | 938 | | |
924 | 939 | | |
| |||
0 commit comments