[
https://issues.apache.org/jira/browse/ARROW-9561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17185365#comment-17185365
]
Antoine Pitrou commented on ARROW-9561:
---------------------------------------
It works, but you have to pass the right type explicitly, e.g.:
{code:python}
>>> import pyarrow as pa
>>> from pyarrow import csv
>>> s = b"""t\n2018-11-13T17:11:10.777000"""
>>> convert_options = csv.ConvertOptions(column_types={'t': pa.timestamp('us')})
>>> table = csv.read_csv(pa.py_buffer(s), convert_options=convert_options)
>>> table
pyarrow.Table
t: timestamp[us]
>>> table.to_pydict()
{'t': [datetime.datetime(2018, 11, 13, 17, 11, 10, 777000)]}
{code}
> [C++] CSV parse fractional seconds in timestamps
> ------------------------------------------------
>
> Key: ARROW-9561
> URL: https://issues.apache.org/jira/browse/ARROW-9561
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++, Python
> Reporter: Frank Smith
> Priority: Minor
> Fix For: 2.0.0
>
>
> It would be great to be able to parse fractional seconds from timestamps in
> CSV files, e.g. 2017-06-26 16:58:20.651901
> strptime does not have a format specifier for fractional seconds, and the
> built-in ISO8601 parser does not parse fractional seconds.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)