Skip to content

COMPAT: python-dateutil deprecation warnings #19004

Closed
@jreback

Description

@jreback

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] ______

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsTimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions