Skip to content

Conversation

@rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Dec 11, 2025

This may still need more discussion.

Docs change:

image

pyproject.toml Outdated
"numpy>=1.26.0",
"python-dateutil>=2.8.2",
"tzdata>=2023.3"
"tzdata>=2023.3; platform_system == 'Windows'",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With tests seeming to be fine with no minimum here (ref: #63264 (comment)), I'm wondering if we should remove the lower bound.

@rhshadrach rhshadrach added the Dependencies Required and optional dependencies label Dec 13, 2025
@rhshadrach rhshadrach marked this pull request as ready for review December 13, 2025 13:20
@jbrockmendel
Copy link
Member

No objection here. I didn't follow the conversation super-closely though.

@mroeschke
Copy link
Member

Just noting that the conda-foge recipe should also be updated to make move python-tzdata to run_contrained (for windows). Could be done in conda-forge/pandas-feedstock#239 if for 3.0

README.md Outdated
- [NumPy - Adds support for large, multi-dimensional arrays, matrices and high-level mathematical functions to operate on these arrays](https://www.numpy.org)
- [python-dateutil - Provides powerful extensions to the standard datetime module](https://dateutil.readthedocs.io/en/stable/index.html)
- [tzdata - Provides an IANA time zone database](https://tzdata.readthedocs.io/en/latest/)
- [tzdata - Provides an IANA time zone database](https://tzdata.readthedocs.io/en/latest/) (Only required on Windows)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or emscriptem?

@jorisvandenbossche
Copy link
Member

I am fine with this, and also fine with removing the lower bound on the version.

Do you know what kind of error you now would get on Windows if you don't have tzdata installed? (I don't know if the import_optional_dependency you removed would have shown a warning before pointing to tzdata)

@jorisvandenbossche jorisvandenbossche added this to the 3.0 milestone Dec 17, 2025
Copy link
Contributor

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably will require a change to the pandas-feedstock for conda

@rhshadrach rhshadrach marked this pull request as draft December 17, 2025 22:54
@rhshadrach
Copy link
Member Author

I added a test for the error message; a bit hacky, can remove if people prefer.

@rhshadrach rhshadrach marked this pull request as ready for review December 17, 2025 23:10
pyproject.toml Outdated
"tzdata>=2023.3"
"tzdata>=2023.3; platform_system == 'Windows'",
# Emscripten is the platform system for Pyodide.
"tzdata>=2023.3; platform_system == 'Emscripten'",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some other packages use sys_platform != "emscripten" instead. Do we know if there is a preference? (I don't directly find a good source about this in the docs)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I took it from here.

https://pyodide.org/en/0.16.1/faq.html#how-to-detect-that-code-is-run-with-pyodide

But looking at the latest version of the docs, it now uses sys.platform.

https://pyodide.org/en/stable/usage/faq.html#how-to-detect-that-code-is-run-with-pyodide

Will update.

@jorisvandenbossche jorisvandenbossche merged commit 639ffc8 into pandas-dev:main Dec 19, 2025
41 checks passed
@jorisvandenbossche
Copy link
Member

Thanks @rhshadrach!

@jorisvandenbossche
Copy link
Member

One comment on the raised error you now get when tzdata is not available:

zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key Europe/Brussels'

That is the same error as you would get with an actual non-existing timezone (eg a typo). Would it still be useful to amend that message with some additional content if zoneinfo.available_timezones() gives an empty result? (just tested in pyodide, and there that function returns an empty set)

@rhshadrach
Copy link
Member Author

rhshadrach commented Dec 19, 2025

No opposition assuming the implementation is reasonable; it's not clear to me what parts of the code we'd have to add try-excepts to do so. But I do think a more informative error message here is zoneinfo's responsibility (and would help all Python users, not just via pandas).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dependencies Required and optional dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: pandas 3.0.0rc0 hard-requires tzdata Python package

5 participants