-
Notifications
You must be signed in to change notification settings - Fork 124
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: allow format=None
in str.to_datetime
#1145
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @FBruzzesi !
just a thought - it looks like here there's a pure-python solution to inferring a format
maybe, in plotly, they could do something like:
- if it's pandas-like or polars, use
to_datetime
withformat=None
- else, take the first non-null element, get the format using the solution above, and try to parse using that?
just an idea - not a blocker for this pr anyway!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we consider doing that in narwhals for pyarrow backend and null format? I think it can be a quite common use case for anything related with timeseries. |
yeah sure! |
Merging this one as is for now and will come back to the arrow dedicate branch in another PR |
* WIP * allow str.to_datetime with format=None
What type of PR is this? (check all applicable)
Checklist
If you have comments or can explain your changes, please do so below.
Opening as draft since(Ok I misscliked) pyarrow is unsupported and may need some discussion for how to achieve it.For context, this is the snippet in plotly that requires casting to datetime: process_dataframe_timeline