You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Antoine Pitrou (JIRA)" <ji...@apache.org> on 2019/06/03 12:45:01 UTC
[jira] [Updated] (ARROW-1773) [C++] Add casts from date/time types
to compatible signed integers
[ https://issues.apache.org/jira/browse/ARROW-1773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Antoine Pitrou updated ARROW-1773:
----------------------------------
Component/s: C++
> [C++] Add casts from date/time types to compatible signed integers
> ------------------------------------------------------------------
>
> Key: ARROW-1773
> URL: https://issues.apache.org/jira/browse/ARROW-1773
> Project: Apache Arrow
> Issue Type: New Feature
> Components: C++
> Reporter: Wes McKinney
> Assignee: Licht Takeuchi
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.8.0
>
>
> e.g.
> {code}
> In [3]: arr = pa.array([1,2,3], type='i4')
> In [4]: arr.cast('date32')
> Out[4]:
> <pyarrow.lib.Date32Array object at 0x7fc35f8b56d8>
> [
> datetime.date(1970, 1, 2),
> datetime.date(1970, 1, 3),
> datetime.date(1970, 1, 4)
> ]
> In [5]: arr.cast('date32').cast('i4')
> ---------------------------------------------------------------------------
> ArrowNotImplementedError Traceback (most recent call last)
> <ipython-input-5-7b6f6cf1cced> in <module>()
> ----> 1 arr.cast('date32').cast('i4')
> /home/wesm/code/arrow/python/pyarrow/array.pxi in pyarrow.lib.Array.cast (/home/wesm/code/arrow/python/build/temp.linux-x86_64-3.5/lib.cxx:28923)()
> 266
> 267 with nogil:
> --> 268 check_status(Cast(_context(), self.ap[0], type.sp_type,
> 269 options, &result))
> 270
> /home/wesm/code/arrow/python/pyarrow/error.pxi in pyarrow.lib.check_status (/home/wesm/code/arrow/python/build/temp.linux-x86_64-3.5/lib.cxx:8306)()
> 83 raise ArrowKeyError(message)
> 84 elif status.IsNotImplemented():
> ---> 85 raise ArrowNotImplementedError(message)
> 86 elif status.IsTypeError():
> 87 raise ArrowTypeError(message)
> ArrowNotImplementedError: /home/wesm/code/arrow/cpp/src/arrow/compute/cast.cc:920 code: GetCastFunction(*array.type(), out_type, options, &func)
> No cast implemented from date32[day] to int32
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)