-
Notifications
You must be signed in to change notification settings - Fork 121
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: scan_csv
#1555
feat: scan_csv
#1555
Conversation
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! there's some merge conflicts, plus some minor comments
narwhals/functions.py
Outdated
This allows the query optimizer to push down predicates and projections | ||
to the scan level, thereby potentially reducing memory overhead. |
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.
this is Polars-specific, perhaps we can remove it?
narwhals/functions.py
Outdated
... return ( | ||
... nw.scan_csv("file.csv", native_namespace=native_namespace) | ||
... .to_native() | ||
... .collect() |
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.
collect
isn't guaranteed to be present on a native frame, can we keep it out of agnostic_scan_csv
? you can just put collect
as the end of the Polars example, and compute
at the end of the dask example
either that, or put collect
before to_native
narwhals/stable/v1/__init__.py
Outdated
This allows the query optimizer to push down predicates and projections | ||
to the scan level, thereby potentially reducing memory overhead. |
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.
same
narwhals/stable/v1/__init__.py
Outdated
... .collect() | ||
... ) | ||
|
||
Then we can read the file by passing Polars or dask namespaces: |
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.
how about
by passing, for example, Polars or Dask namespaces
?
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.
so good, thanks @raisadz !
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