Skip to content

Commit 81f8ace

Browse files
gfyoungjreback
authored andcommitted
COMPAT: Add back remove_na for seaborn (#16992)
Closes gh-16971.
1 parent dc54b6b commit 81f8ace

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

pandas/core/series.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
maybe_convert_platform,
3838
maybe_cast_to_datetime, maybe_castable)
3939
from pandas.core.dtypes.missing import isnull, notnull, remove_na_arraylike
40-
4140
from pandas.core.common import (is_bool_indexer,
4241
_default_index,
4342
_asarray_tuplesafe,
@@ -88,6 +87,17 @@
8887
versionadded_to_excel='\n .. versionadded:: 0.20.0\n')
8988

9089

90+
# see gh-16971
91+
def remove_na(arr):
92+
"""
93+
DEPRECATED : this function will be removed in a future version.
94+
"""
95+
96+
warnings.warn("remove_na is deprecated and is a private "
97+
"function. Do not use.", FutureWarning, stacklevel=2)
98+
return remove_na_arraylike(arr)
99+
100+
91101
def _coerce_method(converter):
92102
""" install the scalar coercion methods """
93103

pandas/tests/series/test_missing.py

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
MultiIndex, Index, Timestamp, NaT, IntervalIndex)
1616
from pandas.compat import range
1717
from pandas._libs.tslib import iNaT
18+
from pandas.core.series import remove_na
1819
from pandas.util.testing import assert_series_equal, assert_frame_equal
1920
import pandas.util.testing as tm
2021

@@ -50,6 +51,11 @@ def _simple_ts(start, end, freq='D'):
5051

5152
class TestSeriesMissingData(TestData):
5253

54+
def test_remove_na_deprecation(self):
55+
# see gh-16971
56+
with tm.assert_produces_warning(FutureWarning):
57+
remove_na(Series([]))
58+
5359
def test_timedelta_fillna(self):
5460
# GH 3371
5561
s = Series([Timestamp('20130101'), Timestamp('20130101'), Timestamp(

0 commit comments

Comments
 (0)