Skip to content

COMPAT: python-dateutil deprecation warnings #19004

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

Closed
jreback opened this issue Dec 30, 2017 · 2 comments · Fixed by #19006
Closed

COMPAT: python-dateutil deprecation warnings #19004

jreback opened this issue Dec 30, 2017 · 2 comments · Fixed by #19006
Labels
Compat pandas objects compatability with Numpy or Python functions Timezones Timezone data dtype
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Dec 30, 2017

not trivial to actually trigger these, but showing up on some of our appeveyor builds.

pandas\tests\indexes\datetimes\test_arithmetic.py:87: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pandas\core\indexes\datetimes.py:2138: in date_range
    closed=closed, **kwargs)
pandas\util\_decorators.py:123: in wrapper
    return func(*args, **kwargs)
pandas\core\indexes\datetimes.py:374: in __new__
    ambiguous=ambiguous)
pandas\core\indexes\datetimes.py:509: in _generate
    tz = timezones.maybe_get_tz(tz)
pandas\_libs\tslibs\timezones.pyx:93: in pandas._libs.tslibs.timezones.maybe_get_tz
    cpdef inline object maybe_get_tz(object tz):
pandas\_libs\tslibs\timezones.pyx:103: in pandas._libs.tslibs.timezones.maybe_get_tz
    tz = dateutil_gettz(zone)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'Asia/Singapore'
    def gettz(name):
        """
        This retrieves a time zone from the local zoneinfo tarball that is packaged
        with dateutil.
    
        :param name:
            An IANA-style time zone name, as found in the zoneinfo file.
    
        :return:
            Returns a :class:`dateutil.tz.tzfile` time zone object.
    
        .. warning::
            It is generally inadvisable to use this function, and it is only
            provided for API compatibility with earlier versions. This is *not*
            equivalent to ``dateutil.tz.gettz()``, which selects an appropriate
            time zone based on the inputs, favoring system zoneinfo. This is ONLY
            for accessing the dateutil-specific zoneinfo (which may be out of
            date compared to the system zoneinfo).
    
        .. deprecated:: 2.6
            If you need to use a specific zoneinfofile over the system zoneinfo,
            instantiate a :class:`dateutil.zoneinfo.ZoneInfoFile` object and call
            :func:`dateutil.zoneinfo.ZoneInfoFile.get(name)` instead.
    
            Use :func:`get_zonefile_instance` to retrieve an instance of the
            dateutil-provided zoneinfo.
        """
        warnings.warn("zoneinfo.gettz() will be removed in future versions, "
                      "to use the dateutil-provided zoneinfo files, instantiate a "
                      "ZoneInfoFile object and use ZoneInfoFile.zones.get() "
                      "instead. See the documentation for details.",
>                     DeprecationWarning)
E       DeprecationWarning: zoneinfo.gettz() will be removed in future versions, to use the dateutil-provided zoneinfo files, instantiate a ZoneInfoFile object and use ZoneInfoFile.zones.get() instead. See the documentation for details.
C:\Miniconda3_64\envs\pandas\lib\site-packages\dateutil\zoneinfo\__init__.py:156: DeprecationWarning
_____ TestDatetimeIndexArithmetic.test_dti_isub_int[dateutil/US/Pacific] ______
@jreback jreback added Compat pandas objects compatability with Numpy or Python functions Difficulty Intermediate Timezones Timezone data dtype labels Dec 30, 2017
@jreback jreback added this to the 0.23.0 milestone Dec 30, 2017
@jreback
Copy link
Contributor Author

jreback commented Dec 30, 2017

cc @jbrockmendel
cc @pganssle

jreback added a commit to jreback/pandas that referenced this issue Dec 30, 2017
STYLE: clean some pytest / linting warnings

xref pandas-dev#19004, dateutil deprecation warnings
@pganssle
Copy link
Contributor

pganssle commented Dec 30, 2017

I think this is just pandas being a bit over-eager about the fact that Windows doesn't ship their own zoneinfo files (and as a result, the users must use the one shipped with dateutil). We deprecated zoneinfo.gettz ages ago as an attractive nuisance.

zoneinfo.gettz and tz.gettz are not completely equivalent because zoneinfo.gettz has a subset of tz.gettz's capabilities, but I think the distinction is unimportant in this case.

(PR #19006 should solve this)

jreback added a commit to jreback/pandas that referenced this issue Dec 30, 2017
STYLE: clean some pytest / linting warnings

xref pandas-dev#19004, dateutil deprecation warnings
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants