Skip to content

Commit

Permalink
COMPAT: Add back remove_na for seaborn (pandas-dev#16992)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung authored and jreback committed Jul 17, 2017
1 parent dc54b6b commit 81f8ace
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
maybe_convert_platform,
maybe_cast_to_datetime, maybe_castable)
from pandas.core.dtypes.missing import isnull, notnull, remove_na_arraylike

from pandas.core.common import (is_bool_indexer,
_default_index,
_asarray_tuplesafe,
Expand Down Expand Up @@ -88,6 +87,17 @@
versionadded_to_excel='\n .. versionadded:: 0.20.0\n')


# see gh-16971
def remove_na(arr):
"""
DEPRECATED : this function will be removed in a future version.
"""

warnings.warn("remove_na is deprecated and is a private "
"function. Do not use.", FutureWarning, stacklevel=2)
return remove_na_arraylike(arr)


def _coerce_method(converter):
""" install the scalar coercion methods """

Expand Down
6 changes: 6 additions & 0 deletions pandas/tests/series/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
MultiIndex, Index, Timestamp, NaT, IntervalIndex)
from pandas.compat import range
from pandas._libs.tslib import iNaT
from pandas.core.series import remove_na
from pandas.util.testing import assert_series_equal, assert_frame_equal
import pandas.util.testing as tm

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

class TestSeriesMissingData(TestData):

def test_remove_na_deprecation(self):
# see gh-16971
with tm.assert_produces_warning(FutureWarning):
remove_na(Series([]))

def test_timedelta_fillna(self):
# GH 3371
s = Series([Timestamp('20130101'), Timestamp('20130101'), Timestamp(
Expand Down

0 comments on commit 81f8ace

Please sign in to comment.