brokenjacobs opened a new issue, #37110:
URL: https://github.com/apache/arrow/issues/37110

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Pyarrow: 12.0.1
   
   This is similar to #32366 but not exactly the same. I have a dataset where I 
am trying to filter by a column in my parquet files that is a timestamp with 
timezone type. Every way that I try to do the filter, pyarrow coerces the type 
to a non-timestamp type and fails to convert to a table. For example:
   ```
   (ds is my dataset)
   >>> dt
   datetime.datetime(2023, 6, 29, 4, 0, tzinfo=<UTC>)
   >>> dcast = pa.scalar(dt, type=pa.timestamp('ms', tz='UTC')
   >>> filter = (ds.field('readout_time')>dcast)
   >>> df = dataset.to_table(filter=filter,columns=['readout_time', 
'acceleration_x', 'acceleration_y', 'acceleration_z']).to_pandas()
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "pyarrow/_dataset.pyx", line 546, in pyarrow._dataset.Dataset.to_table
     File "pyarrow/_dataset.pyx", line 3449, in 
pyarrow._dataset.Scanner.to_table
     File "pyarrow/error.pxi", line 144, in 
pyarrow.lib.pyarrow_internal_check_status
     File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
   pyarrow.lib.ArrowInvalid: Cannot compare timestamp with timezone to 
timestamp without timezone, got: timestamp[ms, tz=UTC] and timestamp[ms]
   ```
   
   This was just my latest attempt to use an actual arrow scaler with timezone, 
and it still changes the type to a non timestamp type in the comparison. It 
also fails using a datetime in the filter directly.
   
   
   ### Component(s)
   
   Python


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to