Skip to content

tz_compare fails to consider string "UTC" and pytz UTC object equal #23959

Closed
@TomAugspurger

Description

@TomAugspurger

Nothing user-facing here, but this surprised me.

In [5]: pd._libs.tslibs.timezones.tz_compare("UTC", pytz.timezone("UTC"))
Out[5]: False

Other timezones behave as expected

In [6]: pd._libs.tslibs.timezones.tz_compare("US/Eastern", pytz.timezone("US/Eastern"))
Out[6]: True

Is this user error, or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    TimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions