feat(rust): casting utf8 to temporal #12072
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #9994 , closes #10478
The implementation I did in this PR support converting strings to date or datetime, it only support specific formats which are the following:
Additionally:
I found that timestamp casting for time-unit milliseconds and microseconds is not implemented in arrow2 library, so I opened this issue.This is now implemented in nano-arrow crate inside polars."2021-01-01 12:54:58.432"
or"2021-01-01 12:54:58"
is not supported by nano-arrow cast function, it only supports RFC3339(or a variation of it), should the other formats be supported as well ? if so I think we should open a different issue for that.pl.DataFrame({"x1":["1234"]}).with_columns(**{ "x1-date": pl.col("x1").cast(pl.Date)})
, this is why I removed pl.Utf8 fromtest_from_epoch
unit test, should it be supported?Example
For a full history of this PR please refer to the comments in #10517 which was close due to errors while rebasing.