Skip to content
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

fix: Treat explode as gather #18431

Merged
merged 4 commits into from
Aug 28, 2024
Merged

fix: Treat explode as gather #18431

merged 4 commits into from
Aug 28, 2024

Conversation

ritchie46
Copy link
Member

This treats an explode operation as a special case of gather for non-trivial types. This will ensure we have the similar behavior across nested types and can also be much faster as the gathers are specialized (think binview types).

fixes #18421

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Aug 28, 2024
@ritchie46 ritchie46 merged commit 79cffee into main Aug 28, 2024
25 checks passed
@ritchie46 ritchie46 deleted the explode branch August 28, 2024 13:11
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 93.42105% with 5 lines in your changes missing coverage. Please review.

Project coverage is 79.92%. Comparing base (37a492e) to head (d9c4f4d).
Report is 2 commits behind head on main.

Files Patch % Lines
...rates/polars-core/src/chunked_array/ops/explode.rs 50.00% 4 Missing ⚠️
...-core/src/chunked_array/ops/explode_and_offsets.rs 98.52% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18431      +/-   ##
==========================================
- Coverage   79.92%   79.92%   -0.01%     
==========================================
  Files        1495     1495              
  Lines      200279   200117     -162     
  Branches     2867     2867              
==========================================
- Hits       160081   159949     -132     
+ Misses      39652    39622      -30     
  Partials      546      546              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -167,7 +167,7 @@ def test_list_struct_explode_6905() -> None:
},
schema={"group": pl.List(pl.Struct([pl.Field("params", pl.List(pl.Int32))]))},
)["group"].list.explode().to_list() == [
{"params": None},
None,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was wrong.

r-brink pushed a commit to r-brink/polars that referenced this pull request Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.explode() PanicException: validity must be equal to the array's length
1 participant