Skip to content

Bump polars version to 1.39.3#371

Merged
Edwardvaneechoud merged 9 commits intomainfrom
claude/upgrade-polars-version-ZE8ZN
Mar 28, 2026
Merged

Bump polars version to 1.39.3#371
Edwardvaneechoud merged 9 commits intomainfrom
claude/upgrade-polars-version-ZE8ZN

Conversation

@Edwardvaneechoud
Copy link
Copy Markdown
Owner

@Edwardvaneechoud Edwardvaneechoud commented Mar 26, 2026

Bump the polars version to 1.39.3

- polars: <1.32 → <1.40 (resolves to 1.39.3), removed Windows version ceiling
- pl-fuzzy-frame-match: >=0.4.0 → >=0.6.0
- polars-simed: ^0.3.4 → >=0.4.0
- polars-ds: >=0.6.0 → >=0.11.0
- polars-distance: ~0.4.3 → >=0.4.3
- polars-expr-transformer: >=0.5.0 → >=0.5.1

Breaking changes addressed:
- group_by().sum/mean/median() now uses cs.numeric() selector since polars
  no longer allows these aggregations on string columns
- Added polars.selectors (cs) to polars_code_parser safe globals
- UDF serialization: detect when LazyFrame JSON serialization loses UDFs
  (shown as ".()") and inject precomputed results directly into flow nodes
- map_elements in group_by agg context changed behavior; tests updated to
  use map_batches with returns_scalar=True
- map_batches now requires return_dtype in lazy contexts; updated test

New dtype support (Float16, UInt128, Int128):
- Added to DataType enum, TypeRegistry, type mappings, code parser globals
- Added to generic_datatype/get_readable_datatype_group classifications
- Excluded Float16 from round precision test (insufficient precision)

https://claude.ai/code/session_01PB1o78uUwTexByBiNTY5rk
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 26, 2026

Deploy Preview for flowfile-wasm ready!

Name Link
🔨 Latest commit a833bc6
🔍 Latest deploy log https://app.netlify.com/projects/flowfile-wasm/deploys/69c7cf377d0d1f00084cfb3e
😎 Deploy Preview https://deploy-preview-371--flowfile-wasm.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Edwardvaneechoud Edwardvaneechoud changed the title Handle UDF serialization loss and improve numeric type support Bump polars version to 1.39.3 Mar 26, 2026
claude and others added 8 commits March 26, 2026 18:22
Binary format preserves UDFs/lambdas (JSON format dropped them in polars
1.39.3). Uses base64 encoding to embed binary data in generated code
strings. Removes the UDF-loss detection and live-result injection
workaround that was needed with JSON serialization.

https://claude.ai/code/session_01PB1o78uUwTexByBiNTY5rk
…ull handling

- Add Int128, UInt128, Float16 to NUMERIC_TYPES_SORTED in test_ui_components
- Update flow engine pivot to fill_null(0) for sum/count/len aggregations
  to match native polars 1.39.3 pivot behavior

https://claude.ai/code/session_01PB1o78uUwTexByBiNTY5rk
…ate pivot expected values

- test_custom_component_integration: add Int128, UInt128, Float16 to expected numeric types
- test_node_designer: add new types to get_expected_numeric_types() and both Numeric assertion sets
- test_flow_data_engine: update test_pivot_numeric expected values from None to 0 for sum agg

https://claude.ai/code/session_01PB1o78uUwTexByBiNTY5rk
…type sets

- Rewrite do_pivot() to use polars LazyFrame.pivot instead of manual
  group_by + filter + struct approach
- Unique pivot values still fetched via worker (fetch_unique_values)
- Handles concat aggregation via pl.element().str.join with empty→null fixup
- Supports multiple aggregations via separate pivots joined together
- Update all test numeric type sets to include Int128, UInt128, Float16

https://claude.ai/code/session_01PB1o78uUwTexByBiNTY5rk
…um/count/len

The original group_by + filter + struct approach is more readable and
doesn't require DataFrame/LazyFrame guards or concat edge-case handling.

https://claude.ai/code/session_01PB1o78uUwTexByBiNTY5rk
…value threading

Instead of stashing precomputed results on self as mutable state,
_add_polars_code() now returns the precomputed result (or None), and
callers pass it to _create_child_frame(precomputed_result=...).

This eliminates:
- Mutable state leak risk if _create_child_frame is not called
- Double-call ambiguity where only the first call gets the result
- Side-channel attribute that could affect unrelated operations

Updated call sites: with_columns, sort, filter, select, group_by agg.

https://claude.ai/code/session_01PB1o78uUwTexByBiNTY5rk
@Edwardvaneechoud Edwardvaneechoud merged commit f9ac0b2 into main Mar 28, 2026
24 checks passed
@Edwardvaneechoud Edwardvaneechoud deleted the claude/upgrade-polars-version-ZE8ZN branch March 28, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants