Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMPAT: Add back remove_na for seaborn #16992

Merged
merged 1 commit into from
Jul 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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