Skip to content
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 **kwargs to read_csv and scan_csv #1560

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

raisadz
Copy link
Contributor

@raisadz raisadz commented Dec 10, 2024

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below

@github-actions github-actions bot added the enhancement New feature or request label Dec 10, 2024
@raisadz raisadz marked this pull request as ready for review December 10, 2024 19:55
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @raisadz !

just one minor comment

also, if we could include a teeny tiny little test which uses nw.read_csv('file.csv', native_namespace=pd, engine='pyarrow') that'd be grand

elif implementation is Implementation.PYARROW:
from pyarrow import csv # ignore-banned-import

native_frame = csv.read_csv(source)
native_frame = csv.read_csv(source, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we need to pass them in line 1020 too?

elif implementation is Implementation.DASK:
native_frame = native_namespace.read_csv(source)
native_frame = native_namespace.read_csv(source, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1102 too

@@ -40,3 +41,13 @@ def test_read_csv_v1(
result = nw_v1.read_csv(filepath, native_namespace=native_namespace)
assert_equal_data(result, data)
assert isinstance(result, nw_v1.DataFrame)


def test_read_csv_kwargs(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is failing on the minimum versions

can we use skipif with the pandas version < (1,5)? there's some other tests that do something like this

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @raisadz !

17339593948838557126235420120830

@MarcoGorelli MarcoGorelli merged commit f483eaa into narwhals-dev:main Dec 11, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants