pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.65k stars 17.92k forks source link

ENH: Explicitly opt out of pytz support #60025

Open davetapley opened 2 weeks ago

davetapley commented 2 weeks ago

Feature Type

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

https://github.com/pandas-dev/pandas/blob/2a10e04a099d5f1633abcdfbb2dd9fdf09142f8d/pandas/_libs/tslibs/timezones.pyx#L25

https://github.com/pandas-dev/pandas/blob/2a10e04a099d5f1633abcdfbb2dd9fdf09142f8d/pandas/_libs/tslibs/timezones.pyx#L41

Alternative Solutions

N/A

Additional Context

rhshadrach commented 2 weeks ago

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?