-
Notifications
You must be signed in to change notification settings - Fork 124
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
feat: add NotImplementedError error for index changing methods Dask #744
Conversation
narwhals/_dask/expr.py
Outdated
@@ -445,6 +450,16 @@ def clip( | |||
returns_scalar=False, | |||
) | |||
|
|||
def head(self) -> NoReturn: | |||
# We can't (yet?) allow methods which modify the index | |||
msg = "`Expr.head` is not supported for the Dask backend. Please use `LazyFrame.head` instead." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick heads up: sadly DaskLazyframe also doesn't implement head
(nor tail
) π₯²
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π« Where can I check that? I only found Dask API reference for Arrays and DataFrames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LazyFrame
will point to DaskLazyFrame
for the dask backend, and the message is suggesting to use such method, so I guess you can check if present in narwhals/_dask/dataframe.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @anopsy ! nice use of noreturn
β¦arwhals-dev#744) * add notImplemented error for index changing methods Dask * add NotImplementedError to index changing methods Dask * add NotImplementedError in Dask drop_null/count * Update expr.py --------- Co-authored-by: Marco Edward Gorelli <[email protected]>
What type of PR is this? (check all applicable)
Related issues
Checklist
If you have comments or can explain your changes, please do so below.
If this looks good I'll also add
NotImplementedError
to the following methods and this PRExpr.sort
Expr.head
Expr.tail