Skip to content

Commit 3529926

Browse files
committed
DEPR: provide deprecations and exposure for NaTType
xref #16137
1 parent 61ca022 commit 3529926

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

pandas/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
moved={'Timestamp': 'pandas.Timestamp',
7878
'Timedelta': 'pandas.Timedelta',
7979
'NaT': 'pandas.NaT',
80+
'NaTType': 'pandas.api.types.NaTType',
8081
'OutOfBoundsDatetime': 'pandas.errors.OutOfBoundsDatetime'})
8182

8283
# use the closest tagged version if possible

pandas/api/types/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
IntervalDtype)
88
from pandas.core.dtypes.concat import union_categoricals # noqa
99
from pandas._libs.lib import infer_dtype # noqa
10+
from pandas._libs.tslib import NaTType # noqa
11+
1012
del np # noqa

pandas/tests/api/test_types.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class TestTypes(Base, tm.TestCase):
3434
'is_named_tuple', 'is_sequence',
3535
'pandas_dtype', 'union_categoricals', 'infer_dtype']
3636
dtypes = ['CategoricalDtype', 'DatetimeTZDtype',
37-
'PeriodDtype', 'IntervalDtype']
37+
'PeriodDtype', 'IntervalDtype', 'NaTType']
3838

3939
def test_types(self):
4040

@@ -93,3 +93,10 @@ def test_moved_infer_dtype():
9393
with catch_warnings(record=True):
9494
e = pandas.lib.infer_dtype('foo')
9595
assert e is not None
96+
97+
98+
def test_moved_NaTType():
99+
100+
with catch_warnings(record=True):
101+
t = pandas.tslib.NaTType
102+
assert t is not None

pandas/tslib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
warnings.warn("The pandas.tslib module is deprecated and will be "
55
"removed in a future version.", FutureWarning, stacklevel=2)
66
from pandas._libs.tslib import (Timestamp, Timedelta,
7-
NaT, OutOfBoundsDatetime)
7+
NaT, NaTType, OutOfBoundsDatetime)

0 commit comments

Comments
 (0)