Commit fceabb3
committed
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 d101879 commit fceabb3
2 files changed
Lines changed: 30 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1844 | 1844 | | |
1845 | 1845 | | |
1846 | 1846 | | |
1847 | | - | |
1848 | | - | |
1849 | | - | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
1850 | 1850 | | |
| 1851 | + | |
| 1852 | + | |
1851 | 1853 | | |
1852 | 1854 | | |
1853 | | - | |
| 1855 | + | |
| 1856 | + | |
1854 | 1857 | | |
1855 | 1858 | | |
1856 | 1859 | | |
1857 | 1860 | | |
1858 | 1861 | | |
1859 | | - | |
| 1862 | + | |
| 1863 | + | |
1860 | 1864 | | |
1861 | 1865 | | |
1862 | 1866 | | |
1863 | 1867 | | |
1864 | 1868 | | |
1865 | | - | |
| 1869 | + | |
| 1870 | + | |
1866 | 1871 | | |
1867 | 1872 | | |
1868 | 1873 | | |
1869 | 1874 | | |
1870 | 1875 | | |
1871 | | - | |
| 1876 | + | |
| 1877 | + | |
1872 | 1878 | | |
1873 | 1879 | | |
1874 | 1880 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
214 | | - | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
226 | | - | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
232 | 247 | | |
233 | 248 | | |
234 | 249 | | |
| |||
0 commit comments