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(python): strptime now respects pl.Datetime's time_unit #6231

Merged
merged 5 commits into from
Jan 15, 2023

Conversation

MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented Jan 14, 2023

closes #6228

Here's my attempt at fixing the linked issue - I'm new to rust so apologies if I've done anything illegal here, I'll study it properly now

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Jan 14, 2023
@MarcoGorelli MarcoGorelli force-pushed the dont-lose-nanosecod branch 2 times, most recently from 23e9dda to 0d3377d Compare January 14, 2023 19:31
@alexander-beedie
Copy link
Collaborator

alexander-beedie commented Jan 14, 2023

I think you should probably make the new tu param an Option on the Rust side and keep the existing logic in place if no explicit timeunit is supplied - that way it can continue to be auto-inferred if desired (eg: if called from Rust; only the Python side appears to examine the format string now, making it a regression for Rust?)

@ritchie46
Copy link
Member

Thank you @MarcoGorelli!

@ritchie46 ritchie46 merged commit 6a1d8bf into pola-rs:master Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.str.strptime(pl.Datetime('ns')) loses nanoseconds
3 participants