Skip to content

BUG: tz_localize(None) with Arrow timestamp #61780

@jbrockmendel

Description

@jbrockmendel

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

# based on test_dt_tz_localize_none
import pandas as pd
import pyarrow as pa

ts = pd.Timestamp("2023-01-02 3:00:00")

ser = pd.Series(
    [ts, None],
    dtype=pd.ArrowDtype(pa.timestamp("ns", tz="US/Pacific")),
)
res = ser.dt.tz_localize(None)

assert res[0] == ser[0].tz_localize(None)  # <- nope!

Issue Description

The pyarrow tz_localize AFAICT is equivalent to .tz_convert("UTC").tz_localize(None)

Expected Behavior

Equivalent to pointwise operation, matching the non-pyarrow tz_localize

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arrowpyarrow functionalityBugDatetimeDatetime data dtypeTimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions