You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [2]: import pyarrow as pa; from datetime import datetime
In [4]: pa.array([datetime(2023, 1, 1)], type=pa.timestamp("ns")).to_pylist()
Out[4]: [Timestamp('2023-01-01 00:00:00')]
From the docs, I assumed Convert to a list of native Python objects. means I should always expected a datetime.datetimeobject, but since I suppose it cannot handle nanosecond components this method returns a pandas.Timestamp when the unit is "ns"
Component(s)
Python
The text was updated successfully, but these errors were encountered:
but since I suppose it cannot handle nanosecond components this method returns a pandas.Timestamp when the unit is "ns"
That's a correct assumption. I don't think there is anything to do about that? (except for raising an error instead, given that datetime.datetime can't handle nanoseconds)
Yeah would be good to document this behavior. Or as you mentioned potentially raising. Or warning that nanosecond components would be dropped if storing in a datetime.datetime. I don't have a strong preference either way.
Describe the enhancement requested
From the docs, I assumed
Convert to a list of native Python objects.
means I should always expected adatetime.datetime
object, but since I suppose it cannot handle nanosecond components this method returns apandas.Timestamp
when the unit is"ns"
Component(s)
Python
The text was updated successfully, but these errors were encountered: