-
Notifications
You must be signed in to change notification settings - Fork 134
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
Tighten-up NativeSeries
Protocol
#2111
Labels
Comments
12 tasks
dangotbanned
added a commit
to vega/altair
that referenced
this issue
Feb 28, 2025
Have a better understanding *now* of what the issue is in (https://github.com/narwhals-dev/narwhals/actions/runs/13577097131/job/37955718895). - This patch is *functionally* the same - but removes the need for ignoring a (typing) warning following (narwhals-dev/narwhals@62f8a1f). - Should also mean we don't need to bump our `narwhals` minimum [again](#3807 (comment)). - **Bonus**: reduced overhead for `<3.11` (python/cpython#84403) ## Related - narwhals-dev/narwhals#2110 - #3811 - narwhals-dev/narwhals#2110 (comment) - narwhals-dev/narwhals#2110 (comment) - narwhals-dev/narwhals#2111
dangotbanned
added a commit
that referenced
this issue
Mar 6, 2025
10 tasks
MarcoGorelli
pushed a commit
that referenced
this issue
Mar 7, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Noticed during (#2110 (comment)) that the current definition is pretty prone to false positives
narwhals/narwhals/typing.py
Lines 39 to 40 in 005b6d5
All of these will error at runtime, but
list[int]
will pass statically aslist.__len__
exists:Solution
For all the cases we support in
nw.from_native
, we can use__array__
to narrow things furtherDiff
Open questions
__array__
be toonumpy
-centric?Series
-like classes we should be aware of?pyarrow.ChunkedArray
,pandas.Series
,polars.Series
Other common methods
filter
unique
value_counts
equals
take
to_numpy
The text was updated successfully, but these errors were encountered: