fix(typing): Avoid overlapping DataFrame, LazyFrame#2944
Conversation
- 76 errors in `tests/frame/join_test.py` - stable errors are expected, as they aren't using updated typing yet
Still same issues on `join`, `v1`, `v2`
May these can be typed *some day*, but they were never safe to begin with
|
These |
| EagerSeriesT, EagerExprT, NativeDataFrameT, "DataFrame[NativeDataFrameT]" | ||
| ], | ||
| CompliantLazyFrame[EagerExprT, NativeDataFrameT, "DataFrame[NativeDataFrameT]"], | ||
| CompliantLazyFrame[EagerExprT, "Incomplete", "DataFrame[NativeDataFrameT]"], |
There was a problem hiding this comment.
Pretty sure this Incomplete is unavoidable, just like the [type-var] warnings on v1.DataFrameLike
narwhals/narwhals/stable/v1/__init__.py
Lines 96 to 98 in 89095ce
I'm much happier to eat those two, when it fixes sooooooooo much else 🥳
|
@MarcoGorelli I just wanna loop you into this one early, since it may be a challenge to keep conflict-free 🙂
Mainly in terms of where we no longer need/now require type ignore(s) |
|
i think this is fine, yes, thanks! |
FBruzzesi
left a comment
There was a problem hiding this comment.
@dangotbanned this seems pretty safe to me but I am still not confident enough to approve a PR solely aiming at improving the typing experience!
So let me play devil's advocate: do you see any risk or anything that can be problematic?
Also I left one question in a test file
Fixed during the series of PRs that ended at #2944

What type of PR is this? (check all applicable)
Related issues
NativeSeriesProtocol #2159TypeVar(s) used in(Data|Lazy)Frame#2356Checklist
If you have comments or can explain your changes, please do so below
Note
Expecting this to cause issues in downstream ci (at least initially)
Everything here (and it is a biggy) stems from this small addition:
The presence of
__len__is enough to avoid overlapping@overloads 🤯