You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "MarcoGorelli (via GitHub)" <gi...@apache.org> on 2023/08/23 17:34:53 UTC

[GitHub] [arrow] MarcoGorelli opened a new issue, #37342: array constructor ignore time zone in `type`

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

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   ```python
   In [16]: pa.array([datetime(2020, 1, 1, tzinfo=timezone(timedelta(hours=-8)))], type=pa.timestamp('us', 'US/Pacific'))
   Out[16]:
   <pyarrow.lib.TimestampArray object at 0x7fb4b56b93c0>
   [
     2020-01-01 08:00:00.000000
   ]
   
   In [17]: pa.array([datetime(2020, 1, 1, tzinfo=timezone(timedelta(hours=-8)))], type=pa.timestamp('us', 'UTC'))
   Out[17]:
   <pyarrow.lib.TimestampArray object at 0x7fb4b51426e0>
   [
     2020-01-01 08:00:00.000000
   ]
   
   In [18]: pa.array([datetime(2020, 1, 1)], type=pa.timestamp('us', 'US/Pacific'))
   Out[18]:
   <pyarrow.lib.TimestampArray object at 0x7fb4b5142500>
   [
     2020-01-01 00:00:00.000000
   ]
   ```
   
   Note how the result doesn't depend on the time zone I put in the `type` argument
   
   Is this intentional? I'm not saying it's a bug or that it needs to change, it just came up in Polars: https://github.com/pola-rs/polars/issues/10662 - I just want to make sure that if there is any change, then we all go towards the same direction
   
   versions:
   - python: 3.10.6
   - pyarrow: 13.0.0
   
   ### 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: issues-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow] mapleFU commented on issue #37342: array constructor ignore time zone in `type`

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on issue #37342:
URL: https://github.com/apache/arrow/issues/37342#issuecomment-1690373206

   This looks a bit like https://github.com/apache/arrow/issues/37110


-- 
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


Re: [I] [Python] array constructor ignore time zone in `type` [arrow]

Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on issue #37342:
URL: https://github.com/apache/arrow/issues/37342#issuecomment-6339349663

   I believe this works as designed and Marco was right to point it out and it was probably handled over in polars.
   Thanks and let's close! 


-- 
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


Re: [I] [Python] array constructor ignore time zone in `type` [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic closed issue #37342: [Python] array constructor ignore time zone in `type`
URL: https://github.com/apache/arrow/issues/37342


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

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


Re: [I] [Python] array constructor ignore time zone in `type` [arrow]

Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on issue #37342:
URL: https://github.com/apache/arrow/issues/37342#issuecomment-6334697692

   @rok I'm going through old `Type: bug` issues. This one asks whether `pa.array([aware_datetime], type=pa.timestamp("us", tz))` ignoring `tz` is intentional; as far as I can tell it is, since timestamp-with-timezone columns store UTC instants and the zone on the type only affects display and conversion back, with naive input treated as UTC. The reporter said they were not claiming a bug, so are you happy for me to close this as answered?


-- 
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