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

Accept quote_char in SplitLines constructor to properly parse newlines #5143

Merged
merged 5 commits into from
Oct 8, 2022
Merged

Accept quote_char in SplitLines constructor to properly parse newlines #5143

merged 5 commits into from
Oct 8, 2022

Conversation

dannyvankooten
Copy link
Contributor

This fixes a small bug when using newlines inside string fields while using a custom quote character. Also includes an unit test and an integration test to make sure the parameter propagates down properly.

Function API could perhaps be cleaned-up a little by making next_line_position() accept a u8 value directly and unwrapping in get_line_stats() but as these functions are marked public I am nowhere near comfortable enough to make that decision.

@ritchie46
Copy link
Member

Function API could perhaps be cleaned-up a little by making next_line_position() accept a u8 value directly and unwrapping in get_line_stats() but as these functions are marked public I am nowhere near comfortable enough to make that decision.

Yeah, I agree we could/should do that more top level in the API. Once a quote char is/or is not provide by the user we immediately should unwrap and only deal with a u8 downstream.

We do already have breaking code, so changes that clean up our code dispatch are welcome. Also in public API's.

@ritchie46 ritchie46 merged commit ba92cdf into pola-rs:master Oct 8, 2022
@dannyvankooten dannyvankooten deleted the dvk-patch-2 branch October 8, 2022 14:26
zundertj pushed a commit to zundertj/polars that referenced this pull request Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants