You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Rok Mihevc (Jira)" <ji...@apache.org> on 2022/03/09 18:41:00 UTC

[jira] [Closed] (ARROW-10431) [C++][Python] Cast timestamp to time32/time64

     [ https://issues.apache.org/jira/browse/ARROW-10431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rok Mihevc closed ARROW-10431.
------------------------------
    Resolution: Fixed

> [C++][Python] Cast timestamp to time32/time64
> ---------------------------------------------
>
>                 Key: ARROW-10431
>                 URL: https://issues.apache.org/jira/browse/ARROW-10431
>             Project: Apache Arrow
>          Issue Type: Wish
>          Components: C++, Python
>    Affects Versions: 2.0.0
>            Reporter: Taras Kuzyo
>            Priority: Minor
>
>  It would be great to have the ability to cast a timestamp to a time type.
> I am not sure about the amount of coding involved but conceptually it looks relatively simple.  
> {code:java}
> >>> pc.cast(pc.strptime('13:13:30', format='%H:%M:%S', unit='s'), pa.time32('s'))
>  Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/usr/local/lib/python3.6/dist-packages/pyarrow/compute.py", line 243, in cast
>  return call_function("cast", [arr], options)
>  File "pyarrow/_compute.pyx", line 446, in pyarrow._compute.call_function
>  File "pyarrow/_compute.pyx", line 275, in pyarrow._compute.Function.call
>  File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
>  File "pyarrow/error.pxi", line 105, in pyarrow.lib.check_status
>  pyarrow.lib.ArrowNotImplementedError: Unsupported cast from timestamp[s] to time32 using function cast_time32{code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)