Commit baa3fe6
Fix ResidualVisitor null handling for comparisons and not-NaN
ResidualVisitor diverged from row-level expression evaluation on null values:
- visit_less_than / visit_less_than_or_equal / visit_greater_than /
visit_greater_than_or_equal compared the partition value to the literal
directly. A nullable identity-partitioned column with a None partition value
raised a TypeError (None < literal), while _ExpressionEvaluator guards with
"value is not None" and treats the row as non-matching. Add the same guard so
a null partition value yields AlwaysFalse instead of crashing during scan
planning (ResidualEvaluator.residual_for).
- visit_not_nan returned AlwaysFalse for a None value because None is not a
SupportsFloat, whereas _ExpressionEvaluator.visit_not_nan (val == val) treats
null as satisfying not-NaN. Invert the check so only NaN fails not-NaN and
null (and any non-float value) passes, matching row evaluation.
Update the test that encoded the old NotNaN(None) -> AlwaysFalse result and add
a regression test covering None partition values for all four ordering
comparisons.
Fixes #3498 (partially)1 parent df0e73e commit baa3fe6
2 files changed
Lines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1880 | 1880 | | |
1881 | 1881 | | |
1882 | 1882 | | |
1883 | | - | |
| 1883 | + | |
| 1884 | + | |
1884 | 1885 | | |
1885 | 1886 | | |
1886 | 1887 | | |
1887 | 1888 | | |
1888 | 1889 | | |
1889 | | - | |
| 1890 | + | |
| 1891 | + | |
1890 | 1892 | | |
1891 | 1893 | | |
1892 | 1894 | | |
1893 | 1895 | | |
1894 | 1896 | | |
1895 | | - | |
| 1897 | + | |
| 1898 | + | |
1896 | 1899 | | |
1897 | 1900 | | |
1898 | 1901 | | |
1899 | 1902 | | |
1900 | 1903 | | |
1901 | | - | |
| 1904 | + | |
| 1905 | + | |
1902 | 1906 | | |
1903 | 1907 | | |
1904 | 1908 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
238 | 253 | | |
239 | 254 | | |
240 | 255 | | |
| |||
0 commit comments