You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (Jira)" <ji...@apache.org> on 2019/08/23 14:28:00 UTC

[jira] [Resolved] (ARROW-4111) [Python] Create time types from Python sequences of integers

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

Wes McKinney resolved ARROW-4111.
---------------------------------
    Resolution: Fixed

Resolved as part of ARROW-6227 in https://github.com/apache/arrow/commit/a3da22ecda8b73a6d2446947a78d915ef493e874

> [Python] Create time types from Python sequences of integers
> ------------------------------------------------------------
>
>                 Key: ARROW-4111
>                 URL: https://issues.apache.org/jira/browse/ARROW-4111
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>            Reporter: Wes McKinney
>            Assignee: Wes McKinney
>            Priority: Major
>              Labels: beginner
>             Fix For: 0.15.0
>
>
> This works for dates, but not times:
> {code}
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>     def test_to_pandas_deduplicate_date_time():
>         nunique = 100
>         repeats = 10
>     
>         unique_values = list(range(nunique))
>     
>         cases = [
>             # array type, to_pandas options
>             ('date32', {'date_as_object': True}),
>             ('date64', {'date_as_object': True}),
>             ('time32[ms]', {}),
>             ('time64[us]', {})
>         ]
>     
>         for array_type, pandas_options in cases:
> >           arr = pa.array(unique_values * repeats, type=array_type)
> pyarrow/tests/test_convert_pandas.py:2392: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> pyarrow/array.pxi:175: in pyarrow.lib.array
>     return _sequence_to_array(obj, mask, size, type, pool, from_pandas)
> pyarrow/array.pxi:36: in pyarrow.lib._sequence_to_array
>     check_status(ConvertPySequence(sequence, mask, options, &out))
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> >   raise ArrowInvalid(message)
> E   pyarrow.lib.ArrowInvalid: ../src/arrow/python/python_to_arrow.cc:1012 : ../src/arrow/python/iterators.h:70 : Could not convert 0 with type int: converting to time32
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)