Skip to content

Commit 8f85315

Browse files
committed
COMPAT: Add back remove_na for seaborn
Closes gh-16971.
1 parent ea487fc commit 8f85315

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

pandas/core/dtypes/missing.py

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import numpy as np
55
from pandas._libs import lib
66
from pandas._libs.tslib import NaT, iNaT
7+
from pandas.util._decorators import deprecate
78
from .generic import (ABCMultiIndex, ABCSeries,
89
ABCIndexClass, ABCGeneric)
910
from .common import (is_string_dtype, is_datetimelike,
@@ -401,3 +402,7 @@ def remove_na_arraylike(arr):
401402
Return array-like containing only true/non-NaN values, possibly empty.
402403
"""
403404
return arr[notnull(lib.values_from_object(arr))]
405+
406+
407+
# see gh-16971
408+
remove_na = deprecate("remove_na", remove_na_arraylike)

pandas/core/series.py

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
maybe_cast_to_datetime, maybe_castable)
3939
from pandas.core.dtypes.missing import isnull, notnull, remove_na_arraylike
4040

41+
# see gh-16971
42+
from pandas.core.dtypes.missing import remove_na # noqa
43+
4144
from pandas.core.common import (is_bool_indexer,
4245
_default_index,
4346
_asarray_tuplesafe,

pandas/tests/dtypes/test_missing.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
from pandas.core.dtypes.dtypes import DatetimeTZDtype
1515
from pandas.core.dtypes.missing import (
1616
array_equivalent, isnull, notnull,
17-
na_value_for_dtype)
17+
na_value_for_dtype, remove_na)
18+
19+
20+
def test_remove_na_deprecation():
21+
# see gh-16971
22+
with tm.assert_produces_warning(FutureWarning):
23+
remove_na(Series([]))
1824

1925

2026
def test_notnull():

0 commit comments

Comments
 (0)