Skip to content

COMPAT: Drop reference to deprecated dateutil.zoneinfo.gettz #19006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 30, 2017

Conversation

pganssle
Copy link
Contributor

@pganssle pganssle commented Dec 30, 2017

I'm assuming these will be handled by CI:

  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

Not sure this is necessary, it's a very "behind the scenes" fix, replacing zoneinfo.gettz with the superior tz.gettz():

  • whatsnew entry

@pganssle pganssle changed the title Drop reference to deprecated dateutil.zoneinfo.gettz COMPAT: Drop reference to deprecated dateutil.zoneinfo.gettz Dec 30, 2017
@pganssle
Copy link
Contributor Author

Original PR adding this was #9123, I believe it was just a bit conservative in switching over to the preferred API.

@jreback
Copy link
Contributor

jreback commented Dec 30, 2017

thanks @pganssle yeah I think this will fix. not really sure why we had this older code.

@jreback jreback added Compat pandas objects compatability with Numpy or Python functions Timezones Timezone data dtype Windows Windows OS labels Dec 30, 2017
@jreback jreback added this to the 0.23.0 milestone Dec 30, 2017
@pganssle
Copy link
Contributor Author

I could see someone writing code like this because they figured that tz.gettz() will prefer system time zones on Mac and *nix, but on Windows there are no system time zones, so you should use the zoneinfo.gettz version. That logic is already built into tz.gettz() though, so it's preferable to just always use tz.gettz (there's another way to get the equivalent of what zoneinfo.gettz() does if you actually care that it's dateutil's zoneinfo files, not the system ones).

@jreback
Copy link
Contributor

jreback commented Dec 30, 2017

@pganssle thanks. might as well just change it, prefer the logic to exist in dateutil anyhow.

well that was the deprecation warning, so this patch should fix us.

@codecov
Copy link

codecov bot commented Dec 30, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@35443b5). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #19006   +/-   ##
=========================================
  Coverage          ?   91.57%           
=========================================
  Files             ?      150           
  Lines             ?    48937           
  Branches          ?        0           
=========================================
  Hits              ?    44815           
  Misses            ?     4122           
  Partials          ?        0
Flag Coverage Δ
#multiple 89.94% <ø> (?)
#single 41.75% <ø> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35443b5...e829ff3. Read the comment docs.

@jreback jreback merged commit e957dcd into pandas-dev:master Dec 30, 2017
@jreback
Copy link
Contributor

jreback commented Dec 30, 2017

thanks @pganssle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Timezones Timezone data dtype Windows Windows OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

COMPAT: python-dateutil deprecation warnings
2 participants