Skip to content

Commit 0de97de

Browse files
committed
change way doing depr modules
1 parent 9e2f9a3 commit 0de97de

File tree

6 files changed

+32
-4
lines changed

6 files changed

+32
-4
lines changed

pandas/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@
5353
from pandas.tools.util import to_numeric
5454
from pandas.core.reshape import melt
5555
from pandas.util.print_versions import show_versions
56-
5756
from pandas.io.api import *
58-
5957
from pandas.util._tester import test
6058

6159
# extension module deprecations

pandas/json.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# flake8: noqa
2+
3+
import warnings
4+
warnings.warn("The pandas.json module is deprecated and will be "
5+
"removed in a future version. Please import from "
6+
"the pandas.io.json instead", FutureWarning, stacklevel=2)
7+
from pandas.io.json.libjson import dumps, loads

pandas/parser.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# flake8: noqa
2+
3+
import warnings
4+
warnings.warn("The pandas.parser module is deprecated and will be "
5+
"removed in a future version. Please import from "
6+
"the pandas.io.parser instead", FutureWarning, stacklevel=2)
7+
from pandas.io.libparsers import na_values

pandas/tests/api/test_api.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,19 @@ def test_deprecation_access_obj(self):
225225
with tm.assert_produces_warning(FutureWarning,
226226
check_stacklevel=False):
227227
pd.datetools.monthEnd
228+
229+
230+
class TestJson(tm.TestCase):
231+
232+
def test_deprecation_access_func(self):
233+
with tm.assert_produces_warning(FutureWarning,
234+
check_stacklevel=False):
235+
pd.json.dumps([])
236+
237+
238+
class TestParser(tm.TestCase):
239+
240+
def test_deprecation_access_func(self):
241+
with tm.assert_produces_warning(FutureWarning,
242+
check_stacklevel=False):
243+
pd.parser.na_values

pandas/tests/frame/test_to_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import numpy as np
99

1010
from pandas.compat import (lmap, range, lrange, StringIO, u)
11-
from pandas.parser import ParserError
11+
from pandas.io.common import ParserError
1212
from pandas import (DataFrame, Index, Series, MultiIndex, Timestamp,
1313
date_range, read_csv, compat, to_datetime)
1414
import pandas as pd

pandas/tests/types/test_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_convert_sql_column_decimals(self):
7373
self.assert_numpy_array_equal(result, expected)
7474

7575
def test_convert_downcast_int64(self):
76-
from pandas.parser import na_values
76+
from pandas.io.libparsers import na_values
7777

7878
arr = np.array([1, 2, 7, 8, 10], dtype=np.int64)
7979
expected = np.array([1, 2, 7, 8, 10], dtype=np.int8)

0 commit comments

Comments
 (0)