Repository navigation
Support Polars 2 - #10398
Support Polars 2#10398
Conversation
Polars 2 removed the `rechunk` keyword from the private `DataFrame._from_arrow`, which broke every `VortexFile.to_polars()` scan. Build each batch with the public `pl.DataFrame` constructor instead, which behaves the same on Polars 1.x and 2.x. Bump the dev dependency so the test suite runs against Polars 2. 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
Merging this PR will regress 1 benchmark
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | bitpack_blocked_compress_avx512 |
4.9 µs | 5.6 µs | -13.25% |
| ⚡ |
Simulation | decode_primitives[i64, (1000, 32)] |
38.2 µs | 24.8 µs | +53.91% |
| ⚡ | WallTime | threshold_neon[8] |
4 µs | 2.7 µs | +45.74% |
| ⚡ | WallTime | threshold_neon[64] |
5.3 µs | 4.2 µs | +26.08% |
| ⚡ | WallTime | threshold_neon[80] |
5.8 µs | 4.6 µs | +24.78% |
| ⚡ | WallTime | filter_neon[64] |
3.5 µs | 3 µs | +15.9% |
| ⚡ | WallTime | bitpack_blocked_compress_avx2 |
7.6 µs | 6.7 µs | +13.53% |
| ⚡ | WallTime | threshold_avx512[8] |
2 µs | 1.8 µs | +12.94% |
| ⚡ | WallTime | threshold_avx512[80] |
3.6 µs | 3.2 µs | +12.32% |
| ⚡ | WallTime | threshold_avx512[64] |
3.2 µs | 2.9 µs | +11.45% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing rk/polars-2 (a585e39) with develop (9d5a844)
Polars releases before 1.32 serialize literal scalars as
`{"dtype": ..., "value": {<dtype>: <value>}}`, which `polars_to_vortex`
rejected, so predicate pushdown in `VortexFile.to_polars()` failed on the
declared `polars>=1.31.0` floor. Unwrap that form before matching.
Relax the dev dependency back to `polars>=1.31.0` (the lockfile stays on
2.0.0) and add a CI step that runs the Polars tests against 1.31.0.
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JaaCDcAfp2xaiQsXemPeKX
Polars releases before 1.32 serialize literal scalars in a different shape. Require 1.32 instead of carrying a compatibility shim for them, and point the CI floor step at 1.32.0. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JaaCDcAfp2xaiQsXemPeKX
Polars 2 re-raises exceptions from an IO source unchanged instead of wrapping them in a ComputeError, so Vortex scan errors surfaced from `to_polars()` as `pyarrow.ArrowInvalid`. Re-raise Arrow errors from the scan as ComputeError so callers see the same exception on both majors. Polars 1.32 through 1.34 serialize decimal literals as [value, scale] without a precision; default the precision to 38, which is what later releases emit for the same literal. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JaaCDcAfp2xaiQsXemPeKX
Add support for polars 2 alongside polars 1. Raise minimum required version to 1.32 to simplify the compatibility
fixes: #10444