Skip to content

ENH: Explicitly opt out of pytz support #60025

Closed
@davetapley

Description

@davetapley
Contributor

Feature Type

  • Adding new functionality to pandas

    Changing existing functionality in pandas

    Removing existing functionality in pandas

Problem Description

I wish I could explicitly opt out of using pytz with pandas, even if another library (APScheduler in my case) uses it as a dependency.

APScheduler is due to also drop pytz requirement in future, but I'd like to get ahead now.

Feature Description

Patch here to

pytz = import_optional_dependency("pytz", errors="ignore")

cdef tzinfo utc_pytz = pytz.UTC if pytz else None

Alternative Solutions

N/A

Additional Context

Activity

rhshadrach

rhshadrach commented on Oct 13, 2024

@rhshadrach
Member

Thanks for the request. From

https://pandas.pydata.org/docs/dev/whatsnew/v3.0.0.html#pytz-now-an-optional-dependency

it is my understanding that in 3.0 you should not be getting pytz objects unless you are explicitly using them. So I'm not sure what it'd mean to "explicitly opt out of pytz". Can you clarify?

added
TimezonesTimezone data dtype
Needs InfoClarification about behavior needed to assess issue
and removed
Needs TriageIssue that has not been reviewed by a pandas team member
on Oct 13, 2024
davetapley

davetapley commented on May 8, 2025

@davetapley
ContributorAuthor

@rhshadrach sorry I missed this.

That sounds like what I need, but I don't see Pandas 3? Is it still beta?
Nvm found it: https://pandas.pydata.org/docs/getting_started/install.html#installing-the-development-version-of-pandas

rhshadrach

rhshadrach commented on May 20, 2025

@rhshadrach
Member

It seems to me there is nothing more to do here. @davetapley - if you disagree, please comment as to why.

removed
Needs InfoClarification about behavior needed to assess issue
on May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @davetapley@rhshadrach

        Issue actions

          ENH: Explicitly opt out of pytz support · Issue #60025 · pandas-dev/pandas