-
Notifications
You must be signed in to change notification settings - Fork 123
Unpin polars v2 #12627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Unpin polars v2 #12627
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12627 +/- ##
==========================================
- Coverage 90.54% 90.52% -0.02%
==========================================
Files 435 435
Lines 30014 30018 +4
==========================================
Hits 27175 27175
- Misses 2839 2843 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes the upper bound constraint on the polars dependency (previously pinned to <1.35), allowing the project to use polars v2. The changes include necessary API migrations and refactoring to maintain compatibility with the newer polars version.
Changes:
- Unpinned polars version constraint in pyproject.toml (from
>=1.32.3, <1.35to>=1.32.3) - Migrated deprecated polars APIs (
map_elementsto expression-based operations andmap_batches) - Vectorized distribution transform functions to handle both scalar and array inputs using numpy operations
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Removed upper bound constraint on polars dependency |
| uv.lock | Updated lock file with polars 1.37.1 and polars-runtime-32 1.37.1, jupyterlab 4.5.2 |
| tests/ert/unit_tests/config/test_gen_kw_config.py | Added warning filter for expected numpy overflow warning in lognormal test |
| tests/ert/ui_tests/cli/test_field_parameter.py | Migrated from map_elements to expression-based polars operations (pl.when, pl.sum_horizontal, pl.max_horizontal); added column reordering logic for robust DataFrame comparison |
| tests/ert/ui_tests/cli/snapshots/test_field_parameter/.../enif_heat_snapshot.csv | Updated snapshot data reflecting polars v2 behavior |
| src/ert/storage/local_ensemble.py | Migrated map_elements to map_batches with proper Series-to-numpy conversion; improved isinstance check for numpy integers |
| src/ert/config/rft_config.py | Added empty array check to prevent DataFrame construction issues |
| src/ert/config/parameter_config.py | Updated type hints for transform_data() to support FloatOrArray |
| src/ert/config/gen_kw_config.py | Updated type hints and imports for FloatOrArray support |
| src/ert/config/distribution.py | Vectorized all transform functions to support both scalar and array inputs using numpy operations; changed from math module to numpy for consistency |
|
Is this ready for review? |
Issue
Resolves #my_issue
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'just rapid-tests')When applicable