You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The conversion itself works fine (eg when specifying type=pa.timestamp("us", tz="America/New_York") in the below example), but inferring the type and timezone from the first value fails if it has a zoneinfo timezone:
In [53]: tz = zoneinfo.ZoneInfo(key='America/New_York')
In [54]: dt = datetime.datetime(2013, 11, 3, 10, 3, 14, tzinfo = tz)
In [55]: pa.array([dt])
....
ArrowInvalid: Objectreturnedbytzinfo.utcoffset(None) isnotaninstanceofdatetime.timedelta
Todd Farmer / @toddfarmer:
This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.
We should verify if we have an explicit test for this, otherwise we can do a PR to add a test before closing this.
Looking for "zoneinfo", I only see it in the hypothesis strategies and in test_types.py (but that is testing more specifically the conversion to/from string for the timezone object itself). I find it a bit hard to see what the hypothesis tests exactly cover, so adding an explicit test might be a good idea.
In test_convert_builtin.py, we have a test like test_sequence_timestamp_with_timezone_inference that uses pytz, we can add something similar with zoneinfo.
…ype inference (#34394)
### What changes are included in this PR?
Explicit test for timestamp inference when creating `pyarrow.Array` with a datetime that has `zoneinfo` timezone specified.
* Closes: #31548
Authored-by: Alenka Frim <frim.alenka@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
The conversion itself works fine (eg when specifying
type=pa.timestamp("us", tz="America/New_York")
in the below example), but inferring the type and timezone from the first value fails if it has a zoneinfo timezone:cc @AlenkaF
Reporter: Joris Van den Bossche / @jorisvandenbossche
Watchers: Rok Mihevc / @rok
Note: This issue was originally created as ARROW-16140. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: