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

fix(rust): Allow read_csv schema to take unparsable types #17765

Merged
merged 5 commits into from
Aug 1, 2024

Conversation

JamesCE2001
Copy link
Contributor

@JamesCE2001 JamesCE2001 commented Jul 21, 2024

Resolves #17349, also including support for pl.Time and pl.Categorical.

read_csv actually already supported passing these types to schema_overrides, but not to schema directly. This is mostly moving that to be shared functionally (which is the cause of the ugly diff in reader.rs) and fixing another bug I found in testing that prevented pl.Time from being read correctly.

@JamesCE2001 JamesCE2001 changed the title Allow read_csv schema to take unparsable types fix(rust): Allow read_csv schema to take unparsable types Jul 21, 2024
@github-actions github-actions bot added fix Bug fix rust Related to Rust Polars and removed title needs formatting labels Jul 21, 2024
Copy link

codecov bot commented Jul 21, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.50%. Comparing base (c537ba3) to head (8a50f88).
Report is 38 commits behind head on main.

Files Patch % Lines
crates/polars-io/src/csv/read/reader.rs 95.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17765      +/-   ##
==========================================
- Coverage   80.50%   80.50%   -0.01%     
==========================================
  Files        1504     1504              
  Lines      197162   197140      -22     
  Branches     2806     2806              
==========================================
- Hits       158732   158703      -29     
- Misses      37909    37916       +7     
  Partials      521      521              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ritchie46 ritchie46 left a comment

Choose a reason for hiding this comment

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

Thanks @JamesCE2001. I've left a few comments.

crates/polars-io/src/csv/read/reader.rs Outdated Show resolved Hide resolved
py-polars/tests/unit/io/test_csv.py Outdated Show resolved Hide resolved
@ritchie46
Copy link
Member

Thanks @JamesCE2001

@ritchie46 ritchie46 merged commit 03cbfd5 into pola-rs:main Aug 1, 2024
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Decimal in read_csv
2 participants