Repository navigation
fix(python): translate Polars fill_null with expression fills - #10192
Conversation
c6b2716 to
b71b362
Compare
Signed-off-by: Daniel King <dan@spiraldb.com>
Native fill_null now supports UTF-8 arrays (#10044), so string literal fills translate to fill_null and match Polars. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E92wUoS3LaqWVJmmS7vKVq
b71b362 to
babf64d
Compare
Merging this PR will regress 2 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | sum_v2_i64 |
193.8 µs | 224.7 µs | -13.73% |
| ❌ | Simulation | sum_i64 |
193.9 µs | 224.6 µs | -13.67% |
| ⚡ | Simulation | decode_primitives[i64, (1000, 32)] |
37.7 µs | 24.6 µs | +53.59% |
| ⚡ | Simulation | random_i128[0.01] |
8.1 µs | 7.2 µs | +12.68% |
| 🆕 | Simulation | varbinview_fill_null_inlined |
N/A | 276.4 µs | N/A |
| 🆕 | Simulation | varbinview_fill_null_outlined |
N/A | 288.6 µs | N/A |
| Simulation | bench_compare_primitive[(10000, 2)] |
< 1 ns | < 1 ns | N/A |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing dk/polars-fill-null (babf64d) with develop (53c7659)2
Footnotes
-
409 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
develop(30e84dc) during the generation of this report, so 53c7659 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Translate Polars
fill_nullto native Vortexfill_nullwhen the fill argument is a literal. For expression fills, such as another column, usezip_(is_null(child), fill, child)because nativefill_nullcurrently requires a constant fill value. Both arguments are recursively translated; no eager evaluation is performed.The tests compare the same predicate over Polars-only and Vortex-backed LazyFrames and check explicit expected row IDs. Three literal-fill cases additionally assert that translation emits native
fill_null; the column-fill case covers a null replacement value.Validation: the column-fill case previously passed with the mapping and raised Polars
ComputeErrorwrappingNotImplementedErrorwhen the converter change was reverted. The latest native literal-fill change, its three new regression cases, and lint have not been run.