Skip to content

Conversation

@dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Nov 25, 2025

Related issues

Description

Note

TODO: List all the new/reimplemented stuff

This PR is a bit of an amuse-bouche.
I've really tried to focus on getting an implementation for all of the methods in the Expr namespace. Man there a lot of them now

Still need to catch up with new stuff on main that wasn't there when I started 😅
Planning to tackle that after the Expr accessor methods

Side Note

I'm fighting the urge pretty hard to rewrite how this version of CompliantExpr works.

Most of what is in (https://github.com/narwhals-dev/narwhals/blob/ce3ec2194e1f67e998c3ea1f989e624aadb05b55/narwhals/_plan/arrow/expr.py) is general visitor logic which would be a slog to repeat in every backend.
It works and I'm finding it easy to reason about, but I 100% plan to put in some more design work.
Just need to endure the pain of doing it the long way for the rest of the Expr namespace ops 😭

Quite odd behavior for scalar lol
Will come back to this later to shrink
Discovered while adding `kurtosis` test which had an empty series
Adding the `skew` test revealed this "edge case"
The rest will allow them to be used in `group_by`
Indirectly adds support for `over` too, but haven't added tests yet
- Still needs tests
- Also unsure what the scalar behavior should be for `mode_all`
I wanna try rewriting this without `numpy` after getting the tests in place
Got quite a few more ideas to experiment with
Each of these are expensive + this version is simpler
Managed to write it with one less `if_else`, but the readability suffered so this will do
Much clearer what each case is testing, covers a slightly more, + generates nice test ids
Using `repr` was making the tests *look* like they worked, but the reality was hairier
Solved *some* of my woes - but it looks like there may be another issue?
At least the expansion worked!
Was already working, but always good to be sure
- Expecting a failure for `<15.0`, just not sure what it'll be
- `unify_dictionaries` may also be new?
- Needed to rethink the typing a bit
  - Accessor methods can return `Expr` or `Scalar` and may not depend on the input shape
- Also, probably found a bug in `polars`
  - Nice to see things held together over here 😄
Mostly typing, but generally things that made sense in an earlier version
- `fill_nan`, `null_count` are on `main`
- the other two are 2/3 of #3028
a mix of things:
- added after the dsl was written
- or deprecated before
- or not support in `pyarrow`
- or I missed it oops
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.

2 participants