Conversation
Only way I've come up with to preserve the deprecation message
I can't work out what is the desired behavior
|
lol, need to pause this PR to resolve #2124 |
CompliantLazyFrameCompliantLazyFrame
|
I really feel like I need some guidance on what the intended API is for From the perspective of a type checker - anything that is called on this attribute must be included: narwhals/narwhals/dataframe.py Line 2213 in df00903 |
@dangotbanned I fell so behind with the progress you made in the last 2-3 weeks, so I am not sure I can help 🙈 Regarding deprecation, that would not affect v1 - would it work to have |
aha no worries @FBruzzesi - it might look like a lot, but really its just formally defining what was already there 🙂
That could work. Initially that might seem insane - but a big positive is we wouldn't need to pass around the Definitely is something we need to have a clear plan for before moving to |
|
Do we need to include deprecated or v1-only methods at all? Can the compliant protocols only cover the main namespace? |
Good questions @MarcoGorelli! We don't need to include anything 😉 Example
If we take that approach and then move to
What does this PR describe?NormalWe've got the main namespace covered with regular definitions like this. narwhals/narwhals/_compliant/dataframe.py Line 189 in df00903 Deprecation (1)Methods that were deprecated in narwhals/narwhals/_compliant/dataframe.py Lines 234 to 235 in df00903 New information I've captured is deprecated functionality, that was not implemented. narwhals/narwhals/_duckdb/dataframe.py Lines 478 to 483 in df00903 I think that's a useful distinction from functionality that is not implemented, but may be in the future: narwhals/narwhals/_duckdb/dataframe.py Line 484 in df00903 Deprecation (2)There's a second kind of deprecation I'm not too sure on, like this: narwhals/narwhals/_compliant/dataframe.py Lines 236 to 239 in df00903 Where
|
same story with Ibis Shall we start with just typing according to the main namespace? |
> error: Cannot access attribute "_change_version" for class "CompliantLazyFrame[Any, FrameT@_stableify]"
MarcoGorelli
left a comment
There was a problem hiding this comment.
thanks, looks good, just a couple of comments
`mypy` expands to an invalid type > "CompliantLazyFrame[Any, NativeFrame]" of "Any | CompliantLazyFrame[Any, NativeFrame] | CompliantLazyFrame[Any, DataFrame[Any]] | CompliantLazyFrame[Any, LazyFrame[Any]] | CompliantLazyFrame[Any, DataFrameLike]"
| subset: Sequence[str] | None, | ||
| *, | ||
| keep: Literal["any", "first", "last", "none"], | ||
| keep: Literal["any", "none"], |
There was a problem hiding this comment.
This was overkill
The real problem to solve was duckdb using keep: str
narwhals/narwhals/_duckdb/dataframe.py
Line 349 in a6361cd
* chore: Add `CompliantDataFrame.native` -> `NativeFrame` Related: - #2232 - #2230 - #2130 * chore: Coverage for `PolarsDataFrame.native` * refactor: remove already imported imports * chore: Coverage for `ArrowDataFrame.native` * chore: Cov for `PandasLikeDataFrame.native` * refactor: Clean up `ArrowDataFrame` * unbreak `ArrowDataFrame.with_columns` and write an essay

What type of PR is this? (check all applicable)
Related issues
Compliant*protocols #2230ArrowDataFrame.explode#1644TypeVar(s) used innw.(BaseFrame|Series)are recursive #2239Checklist
If you have comments or can explain your changes, please do so below
Incompletemarkers (df00903)