[ https://issues.apache.org/jira/browse/ARROW-6974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Antoine Pitrou closed ARROW-6974. --------------------------------- Resolution: Done This works now: {code:python} >>> s = pa.scalar(datetime.now()) >>> s <pyarrow.TimestampScalar: datetime.datetime(2021, 11, 23, 19, 48, 19, 732990)> >>> pc.cast(s, pa.timestamp('ns')) <pyarrow.TimestampScalar: Timestamp('2021-11-23 19:48:19.732990')> >>> pc.cast(s, pa.timestamp('ns', 'Europe/Paris')) <pyarrow.TimestampScalar: Timestamp('2021-11-23 20:48:19.732990+0100', tz='Europe/Paris')> >>> pc.cast(s, pa.timestamp('ns', 'UTC')) <pyarrow.TimestampScalar: Timestamp('2021-11-23 19:48:19.732990+0000', tz='UTC')> {code} > [C++] Refactor temporal casts to work with Scalar inputs > -------------------------------------------------------- > > Key: ARROW-6974 > URL: https://issues.apache.org/jira/browse/ARROW-6974 > Project: Apache Arrow > Issue Type: Improvement > Components: C++ > Reporter: Joris Van den Bossche > Priority: Minor > > Currently, the casting for time-like data is done with the {{ShiftTime}} > function. It _might_ be possible to simplify this with ArrayDataVisitor (to > avoid looping / checking the bitmap). -- This message was sent by Atlassian Jira (v8.20.1#820001)