Skip to content

REGR: DatetimeTZDtype.__from_arrow__ interprets UTC values as local wall time #56775

@jorisvandenbossche

Description

@jorisvandenbossche

Using the latest pandas:

In [6]: ser = pd.Series(pd.to_datetime(["2012-01-01", "2012-01-02"]).tz_localize("Europe/Brussels")) In [7]: ser Out[7]: 0 2012-01-01 00:00:00+01:00 1 2012-01-02 00:00:00+01:00 dtype: datetime64[ns, Europe/Brussels] In [8]: pa.array(ser) Out[8]: <pyarrow.lib.TimestampArray object at 0x7f695b4625c0> [ 2011-12-31 23:00:00.000000000, # <-- those values show the UTC timestamps, so this is correct 2012-01-01 23:00:00.000000000 ] In [9]: ser.dtype.__from_arrow__(pa.array(ser)) Out[9]: <DatetimeArray> ['2011-12-31 23:00:00+01:00', '2012-01-01 23:00:00+01:00'] # <-- still the UTC wall time, but with tz offset -> wrong Length: 2, dtype: datetime64[ns, Europe/Brussels] 

I assume this is caused by #56043 cc @jbrockmendel

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arrowpyarrow functionalityBlockerBlocking issue or pull request for an upcoming releaseRegressionFunctionality that used to work in a prior pandas versionTimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions