westonpace commented on issue #15226:
URL: https://github.com/apache/arrow/issues/15226#issuecomment-1376578323
Casting from duration to `int64` should be a zero-copy operation:
```
>>> import pyarrow as pa
>>> import datetime
>>> arr = pa.array([datetime.timedelta(days=1), datetime.timedelta(hours=1)])
>>> arr
<pyarrow.lib.DurationArray object at 0x7f6efa8e60e0>
[
86400000000,
3600000000
]
>>> arr.cast(pa.int64())
<pyarrow.lib.Int64Array object at 0x7f6e6edc86a0>
[
86400000000,
3600000000
]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]