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

chore(python): let read_csv take Sequence as columns, remove several type: ignore #7028

Merged
merged 5 commits into from Feb 19, 2023

Conversation

MarcoGorelli
Copy link
Collaborator

read_csv can take a sequence for columns, just like other IO functions

In [77]: pl.read_csv(io.StringIO('a,b\n1,2\n'), columns=('a',))
Out[77]:
shape: (1, 1)
┌─────┐
│ a   │
│ --- │
│ i64 │
╞═════╡
│ 1   │
└─────┘

Making the typing a bit laxer, and removing a few type: ignore along the way

@github-actions github-actions bot added chore Maintenance work that does not impact the user python Related to Python Polars labels Feb 19, 2023
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

A few things stick out to me - let me know your thoughts!

py-polars/polars/_html.py Show resolved Hide resolved
py-polars/polars/internals/series/datetime.py Outdated Show resolved Hide resolved
py-polars/polars/utils.py Outdated Show resolved Hide resolved
py-polars/polars/utils.py Outdated Show resolved Hide resolved
py-polars/polars/utils.py Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@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 @stinodego for your review! I've added some responses and have updated

py-polars/polars/internals/series/datetime.py Outdated Show resolved Hide resolved
py-polars/polars/utils.py Outdated Show resolved Hide resolved
py-polars/polars/utils.py Outdated Show resolved Hide resolved
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

Great, let's get this merged! Thanks for the improvement 👍

@stinodego stinodego merged commit e1ce338 into pola-rs:master Feb 19, 2023
josemasar pushed a commit to josemasar/polars that referenced this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance work that does not impact the user python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants