You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Wainberg (via GitHub)" <gi...@apache.org> on 2024/03/30 05:14:23 UTC

Re: [I] [Python] bool followed by float disallowed, but float followed by bool allowed [arrow]

Wainberg commented on issue #40909:
URL: https://github.com/apache/arrow/issues/40909#issuecomment-2027920554

   Another example, with `datetime.time` and `int`:
   
   ```python
   >>> import datetime, pyarrow as pa
   >>> pa.array([1, datetime.time(1, 2, 3)])
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "pyarrow/array.pxi", line 344, in pyarrow.lib.array
     File "pyarrow/array.pxi", line 42, in pyarrow.lib._sequence_to_array
     File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
     File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
   pyarrow.lib.ArrowInvalid: Could not convert datetime.time(1, 2, 3) with type datetime.time: tried to convert to int64
   >>> pa.array([datetime.time(1, 2, 3), 1])
   <pyarrow.lib.Time64Array object at 0x7fba60c40040>
   [
     01:02:03.000000,
     00:00:00.000001
   ]
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org