Skip to content

feat(expr-ir): Add {DataFrame,Series}.explode(empty_as_nulls, keep_nulls)#3347

Merged
dangotbanned merged 21 commits intoexpr-ir/plz-finish-arrow-exprfrom
expr-ir/explode
Dec 9, 2025
Merged

feat(expr-ir): Add {DataFrame,Series}.explode(empty_as_nulls, keep_nulls)#3347
dangotbanned merged 21 commits intoexpr-ir/plz-finish-arrow-exprfrom
expr-ir/explode

Conversation

@dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Dec 9, 2025

Description

Discovered a way to do ArrowDataFrame.explode, while staying vectorized.

Additionally, (https://github.com/pola-rs/polars/releases/tag/py-1.36.0) just added some options which allow some optimizations - so I've implemented those as well 😏
This is particularly helpful for pyarrow, as explode(empty_as_nulls=False, keep_nulls=False) is what happens natively if we don't get in the way.

Note

I've split this out from (#3325) to make it easier to upstream if wanted
50% of the LOC is in (https://github.com/narwhals-dev/narwhals/blob/e86c66dd5976fdbf24b68eff58bd4878b909d227/tests/plan/explode_test.py)

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

@dangotbanned dangotbanned added internal pyarrow Issue is related to pyarrow backend labels Dec 9, 2025
@dangotbanned dangotbanned mentioned this pull request Dec 9, 2025
10 tasks
@dangotbanned dangotbanned marked this pull request as ready for review December 9, 2025 14:11
@dangotbanned dangotbanned merged commit 8283a47 into expr-ir/plz-finish-arrow-expr Dec 9, 2025
26 of 38 checks passed
@dangotbanned dangotbanned deleted the expr-ir/explode branch December 9, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal pyarrow Issue is related to pyarrow backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant