Skip to content

Support Polars 2 - #10398

Merged
robert3005 merged 5 commits into
developfrom
rk/polars-2
Oct 12, 2026
Merged

robert3005 merged 5 commits into
developfrom
rk/polars-2

Conversation

@robert3005

@robert3005 robert3005 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Add support for polars 2 alongside polars 1. Raise minimum required version to 1.32 to simplify the compatibility

fixes: #10444

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
@robert3005 robert3005 added the changelog/fix A bug fix label Oct 8, 2026 — with Claude
@codspeed

codspeed Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ 1 benchmark measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. This result is not comparable, so it counts as unchanged.

Preventing compiler optimizations

⚠️ 25 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 9 improved benchmarks
❌ 1 regressed benchmark
✅ 2197 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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)

Open in CodSpeed

@robert3005
robert3005 marked this pull request as draft October 8, 2026 18:32
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
@robert3005
robert3005 marked this pull request as ready for review October 12, 2026 14:47
@robert3005
robert3005 requested a review from danking October 12, 2026 20:38
@robert3005 robert3005 added changelog/feature A new feature and removed changelog/fix A bug fix labels Oct 12, 2026
@robert3005 robert3005 changed the title fix(python): support Polars 2 support Polars 2 Oct 12, 2026
@robert3005 robert3005 changed the title support Polars 2 Support Polars 2 Oct 12, 2026
@robert3005
robert3005 enabled auto-merge (squash) October 12, 2026 20:39
@robert3005
robert3005 merged commit fdba755 into develop Oct 12, 2026
128 of 130 checks passed
@robert3005
robert3005 deleted the rk/polars-2 branch October 12, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python v0.88 does not work with polars 2.0

3 participants