pandas icon indicating copy to clipboard operation
pandas copied to clipboard

DEPS/TST: tzdata is optional, not required

Open lithomas1 opened this issue 3 years ago • 11 comments

  • [ ] closes #47332 (Replace xxxx with the Github issue number)
  • [ ] Tests added and passed if fixing a bug or adding a new feature
  • [ ] All code checks passed.
  • [ ] Added type annotations to new arguments/methods/functions.
  • [ ] Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

lithomas1 avatar Jun 22 '22 17:06 lithomas1

OK, this works now. We should probably specify a minimum tzdata version too, though.

@jbrockmendel Do you have anything in mind?

lithomas1 avatar Jun 22 '22 19:06 lithomas1

no idea, cc @pganssle ?

jbrockmendel avatar Jun 22 '22 20:06 jbrockmendel

seems fine, does this need backport?

jreback avatar Jun 22 '22 22:06 jreback

We should probably specify a minimum tzdata version too, though.

My 2c is might as well have the min version be the latest available version since this is a new feature.

does this need backport?

Don't think so since ZoneInfo support will be new for 1.5.

mroeschke avatar Jun 22 '22 22:06 mroeschke

does this need backport?

Don't think so since ZoneInfo support will be new for 1.5.

correct. the failures were only on nightlies (main). 1.4.x is passing tests (or was when I last run the build test which is running again now ready for release https://github.com/MacPython/pandas-wheels/pull/173)

simonjayhawkins avatar Jun 22 '22 23:06 simonjayhawkins

Zoneinfo is also kinda wonky, since it doesn't really need the tzdata package, just a copy of the IANA tz database. I'm not sure we have a way to check the version of the IANA tz database, though.

lithomas1 avatar Jun 23 '22 03:06 lithomas1

Zoneinfo is also kinda wonky, since it doesn't really need the tzdata package, just a copy of the IANA tz database. I'm not sure we have a way to check the version of the IANA tz database, though.

I don't think we should necessarily runtime check tzdata in pandas, but it would be good to state that the minimum version we test with tzdata=2022.1

mroeschke avatar Jun 23 '22 20:06 mroeschke

This is blocking #47442, so we should probably merge this now, and open an issue to discuss tzdata version, since there is not yet enough consensus on that.

lithomas1 avatar Jun 29 '22 03:06 lithomas1

IMO setting tzdata=2022.1 should be okay for now.

mroeschke avatar Jun 29 '22 17:06 mroeschke

OK, so I've updated this PR again. It's too difficult/costly to check the version of the system IANA tz db if present, so we're just going to specify a minimum version.

If tzdata is installed, though, the minimum version will be enforced through a warning, even if they have an up to date IANA tz db, since we would want to warn them of the mismatch.

lithomas1 avatar Aug 04 '22 03:08 lithomas1

Hello @lithomas1! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2022-08-09 13:55:50 UTC

pep8speaks avatar Aug 05 '22 13:08 pep8speaks

I'm going to self merge this in a couple of days if no other comments, so we can get the Python 3.11 testing in.

lithomas1 avatar Aug 11 '22 17:08 lithomas1

thanks @lithomas1 this is great

jreback avatar Aug 12 '22 00:08 jreback