Skip to content

Commit

Permalink
CLN: Remove pd.parser, lib, and tslib (pandas-dev#23378)
Browse files Browse the repository at this point in the history
xref pandas-devgh-15537.

Need to bumpy xarray version for
Travis 2.7 because 0.8.0 becomes
incompatible with this change.
  • Loading branch information
gfyoung authored and tm9k1 committed Nov 19, 2018
1 parent 45b5dc1 commit 1c9f993
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 86 deletions.
2 changes: 1 addition & 1 deletion ci/travis-27.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies:
- s3fs
- scipy
- sqlalchemy=0.9.6
- xarray=0.8.0
- xarray=0.9.6
- xlrd=0.9.2
- xlsxwriter=0.5.2
- xlwt=0.7.5
Expand Down
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.24.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,7 @@ Removal of prior version deprecations/changes
- Removal of the previously deprecated ``as_indexer`` keyword completely from ``str.match()`` (:issue:`22356`, :issue:`6581`)
- Removed the ``pandas.formats.style`` shim for :class:`pandas.io.formats.style.Styler` (:issue:`16059`)
- :meth:`Categorical.searchsorted` and :meth:`Series.searchsorted` have renamed the ``v`` argument to ``value`` (:issue:`14645`)
- ``pandas.parser``, ``pandas.lib``, and ``pandas.tslib`` have been removed (:issue:`15537`)
- :meth:`TimedeltaIndex.searchsorted`, :meth:`DatetimeIndex.searchsorted`, and :meth:`PeriodIndex.searchsorted` have renamed the ``key`` argument to ``value`` (:issue:`14645`)
- Removal of the previously deprecated module ``pandas.json`` (:issue:`19944`)
- :meth:`SparseArray.get_values` and :meth:`SparseArray.to_dense` have dropped the ``fill`` parameter (:issue:`14686`)
Expand Down
18 changes: 0 additions & 18 deletions pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,6 @@
from pandas.util._tester import test
import pandas.testing

# extension module deprecations
from pandas.util._depr_module import _DeprecatedModule

parser = _DeprecatedModule(deprmod='pandas.parser',
removals=['na_values'],
moved={'CParserError': 'pandas.errors.ParserError'})
lib = _DeprecatedModule(deprmod='pandas.lib', deprmodto=False,
moved={'Timestamp': 'pandas.Timestamp',
'Timedelta': 'pandas.Timedelta',
'NaT': 'pandas.NaT',
'infer_dtype': 'pandas.api.types.infer_dtype'})
tslib = _DeprecatedModule(deprmod='pandas.tslib',
moved={'Timestamp': 'pandas.Timestamp',
'Timedelta': 'pandas.Timedelta',
'NaT': 'pandas.NaT',
'NaTType': 'type(pandas.NaT)',
'OutOfBoundsDatetime': 'pandas.errors.OutOfBoundsDatetime'})

# use the closest tagged version if possible
from ._version import get_versions
v = get_versions()
Expand Down
8 changes: 0 additions & 8 deletions pandas/lib.py

This file was deleted.

8 changes: 0 additions & 8 deletions pandas/parser.py

This file was deleted.

23 changes: 1 addition & 22 deletions pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TestPDApi(Base):
'util', 'options', 'io']

# these are already deprecated; awaiting removal
deprecated_modules = ['parser', 'lib', 'tslib']
deprecated_modules = []

# misc
misc = ['IndexSlice', 'NaT']
Expand Down Expand Up @@ -172,27 +172,6 @@ def test_get_store(self):
s.close()


class TestParser(object):

@pytest.mark.filterwarnings("ignore")
def test_deprecation_access_func(self):
pd.parser.na_values


class TestLib(object):

@pytest.mark.filterwarnings("ignore")
def test_deprecation_access_func(self):
pd.lib.infer_dtype('foo')


class TestTSLib(object):

@pytest.mark.filterwarnings("ignore")
def test_deprecation_access_func(self):
pd.tslib.Timestamp('20160101')


class TestTypes(object):

def test_deprecation_access_func(self):
Expand Down
14 changes: 0 additions & 14 deletions pandas/tests/api/test_types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
import sys
import pytest

from pandas.api import types
Expand Down Expand Up @@ -53,16 +52,3 @@ def test_deprecated_from_api_types(self):
with tm.assert_produces_warning(FutureWarning,
check_stacklevel=False):
getattr(types, t)(1)


def test_moved_infer_dtype():
# del from sys.modules to ensure we try to freshly load.
# if this was imported from another test previously, we would
# not see the warning, since the import is otherwise cached.
sys.modules.pop("pandas.lib", None)

with tm.assert_produces_warning(FutureWarning):
import pandas.lib

e = pandas.lib.infer_dtype('foo')
assert e is not None
8 changes: 0 additions & 8 deletions pandas/tests/test_errors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-

import pytest
from warnings import catch_warnings, simplefilter
import pandas # noqa
import pandas as pd
from pandas.errors import AbstractMethodError
Expand Down Expand Up @@ -47,13 +46,6 @@ def test_error_rename():
except CParserError:
pass

with catch_warnings(record=True):
simplefilter("ignore")
try:
raise ParserError()
except pd.parser.CParserError:
pass


class Foo(object):
@classmethod
Expand Down
7 changes: 0 additions & 7 deletions pandas/tslib.py

This file was deleted.

0 comments on commit 1c9f993

Please sign in to comment.