diff --git a/doc/source/whatsnew/v0.24.0.txt b/doc/source/whatsnew/v0.24.0.txt index 42e286f487a7d..2d0bd9aa0de39 100644 --- a/doc/source/whatsnew/v0.24.0.txt +++ b/doc/source/whatsnew/v0.24.0.txt @@ -391,7 +391,7 @@ Removal of prior version deprecations/changes - The ``LongPanel`` and ``WidePanel`` classes have been removed (:issue:`10892`) - Several private functions were removed from the (non-public) module ``pandas.core.common`` (:issue:`22001`) -- +- Removal of the previously deprecated module ``pandas.core.datetools`` (:issue:`14105`, :issue:`14094`) - .. _whatsnew_0240.performance: diff --git a/pandas/core/api.py b/pandas/core/api.py index 92586235df93c..32df317a602a9 100644 --- a/pandas/core/api.py +++ b/pandas/core/api.py @@ -32,17 +32,6 @@ from pandas.core.tools.datetimes import to_datetime from pandas.core.tools.timedeltas import to_timedelta -# see gh-14094. -from pandas.util._depr_module import _DeprecatedModule - -_removals = ['day', 'bday', 'businessDay', 'cday', 'customBusinessDay', - 'customBusinessMonthEnd', 'customBusinessMonthBegin', - 'monthEnd', 'yearEnd', 'yearBegin', 'bmonthEnd', 'bmonthBegin', - 'cbmonthEnd', 'cbmonthBegin', 'bquarterEnd', 'quarterEnd', - 'byearEnd', 'week'] -datetools = _DeprecatedModule(deprmod='pandas.core.datetools', - removals=_removals) - from pandas.core.config import (get_option, set_option, reset_option, describe_option, option_context, options) diff --git a/pandas/core/datetools.py b/pandas/core/datetools.py deleted file mode 100644 index 83167a45369c4..0000000000000 --- a/pandas/core/datetools.py +++ /dev/null @@ -1,55 +0,0 @@ -"""A collection of random tools for dealing with dates in Python. - -.. deprecated:: 0.19.0 - Use pandas.tseries module instead. -""" - -# flake8: noqa - -import warnings - -from pandas.core.tools.datetimes import * -from pandas.tseries.offsets import * -from pandas.tseries.frequencies import * - -warnings.warn("The pandas.core.datetools module is deprecated and will be " - "removed in a future version. Please use the pandas.tseries " - "module instead.", FutureWarning, stacklevel=2) - -day = DateOffset() -bday = BDay() -businessDay = bday -try: - cday = CDay() - customBusinessDay = CustomBusinessDay() - customBusinessMonthEnd = CBMonthEnd() - customBusinessMonthBegin = CBMonthBegin() -except NotImplementedError: - cday = None - customBusinessDay = None - customBusinessMonthEnd = None - customBusinessMonthBegin = None -monthEnd = MonthEnd() -yearEnd = YearEnd() -yearBegin = YearBegin() -bmonthEnd = BMonthEnd() -bmonthBegin = BMonthBegin() -cbmonthEnd = customBusinessMonthEnd -cbmonthBegin = customBusinessMonthBegin -bquarterEnd = BQuarterEnd() -quarterEnd = QuarterEnd() -byearEnd = BYearEnd() -week = Week() - -# Functions/offsets to roll dates forward -thisMonthEnd = MonthEnd(0) -thisBMonthEnd = BMonthEnd(0) -thisYearEnd = YearEnd(0) -thisYearBegin = YearBegin(0) -thisBQuarterEnd = BQuarterEnd(0) -thisQuarterEnd = QuarterEnd(0) - -# Functions to check where a date lies -isBusinessDay = BDay().onOffset -isMonthEnd = MonthEnd().onOffset -isBMonthEnd = BMonthEnd().onOffset diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index ddee4894456ea..18d3fbd419c08 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -35,7 +35,7 @@ class TestPDApi(Base): 'util', 'options', 'io'] # these are already deprecated; awaiting removal - deprecated_modules = ['datetools', 'parser', 'json', 'lib', 'tslib'] + deprecated_modules = ['parser', 'json', 'lib', 'tslib'] # misc misc = ['IndexSlice', 'NaT'] @@ -127,19 +127,6 @@ def test_testing(self): self.check(testing, self.funcs) -class TestDatetoolsDeprecation(object): - - def test_deprecation_access_func(self): - with tm.assert_produces_warning(FutureWarning, - check_stacklevel=False): - pd.datetools.to_datetime('2016-01-01') - - def test_deprecation_access_obj(self): - with tm.assert_produces_warning(FutureWarning, - check_stacklevel=False): - pd.datetools.monthEnd - - class TestTopLevelDeprecations(object): # top-level API deprecations