-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
[doc] Convert custom datetime column when reading a CSV file #27854
Conversation
Signed-off-by: Philipp Moritz <pcmoritz@gmail.com>
e7834a1
to
1eec504
Compare
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.
LGTM
python/ray/data/read_api.py
Outdated
>>> # Convert a date column with a custom format from a CSV file. | ||
>>> from pyarrow import csv | ||
>>> convert_options = csv.ConvertOptions( | ||
... timestamp_parsers=["%m/%d/%Y"]) |
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.
Would it make sense to generalize this example to all convert_options
(pyarrow.csv.ConvertOptions) or even arrow_csv_args
?
In other words, should we delegate this documentation over to Arrow?
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.
Yes, part of my desire to document this is to make sure that people know how to put in arbitrary ConvertOptions
(and I wanted to show one that is probably particularly useful as an example). I'll add a note about the more general case and also link the Arrow documentation :)
9a8934a
to
4783086
Compare
4783086
to
9a8934a
Compare
Haha yeah, I fixed it now :) |
…ject#27854) Signed-off-by: Philipp Moritz <pcmoritz@gmail.com>
…ject#27854) Signed-off-by: Philipp Moritz <pcmoritz@gmail.com> Signed-off-by: ilee300a <ilee300@anyscale.com>
Why are these changes needed?
Give an example of how a datetime column can be parsed when reading a CSV file.
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.