-
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: read_csv
#1551
feat: read_csv
#1551
Conversation
narwhals/functions.py
Outdated
>>> agnostic_read_csv(native_namespace=pd) # doctest:+SKIP | ||
>>> agnostic_read_csv(native_namespace=pl) # doctest:+SKIP | ||
>>> agnostic_read_csv(native_namespace=pa) # doctest:+SKIP |
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.
even though the example is being skipped, can we still show a sample dataframe as output?
like
a b
0 1 4
1 2 5
2 3 6
for pandas
shape: (3, 2)
┌─────┬─────┐
│ a ┆ b │
│ --- ┆ --- │
│ i64 ┆ i64 │
╞═════╪═════╡
│ 1 ┆ 4 │
│ 2 ┆ 5 │
│ 3 ┆ 6 │
└─────┴─────┘
for polars
pyarrow.Table
a: int64
b: int64
----
a: [[1,2,3]]
b: [[4,5,6]]
for pyarrow
?
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.
awesome, thanks! just some minor comments
tests/read_csv_test.py
Outdated
|
||
def test_read_csv( | ||
tmpdir: pytest.TempdirFactory, | ||
constructor: Constructor, |
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.
shall we just use constructor_eager
, is this is only implemented in the eager case anyway?
result = nw_v1.read_csv(filepath, native_namespace=native_namespace) | ||
assert_equal_data(result, data) |
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.
can we also check that result
is a nw_v1.DataFrame
? (isinstance
)
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 @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