Skip to content

Commit

Permalink
COMPAT: Add back remove_na for seaborn
Browse files Browse the repository at this point in the history
Closes gh-16971.
  • Loading branch information
gfyoung committed Jul 17, 2017
1 parent ea487fc commit 8f85315
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pandas/core/dtypes/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import numpy as np
from pandas._libs import lib
from pandas._libs.tslib import NaT, iNaT
from pandas.util._decorators import deprecate
from .generic import (ABCMultiIndex, ABCSeries,
ABCIndexClass, ABCGeneric)
from .common import (is_string_dtype, is_datetimelike,
Expand Down Expand Up @@ -401,3 +402,7 @@ def remove_na_arraylike(arr):
Return array-like containing only true/non-NaN values, possibly empty.
"""
return arr[notnull(lib.values_from_object(arr))]


# see gh-16971
remove_na = deprecate("remove_na", remove_na_arraylike)
3 changes: 3 additions & 0 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
maybe_cast_to_datetime, maybe_castable)
from pandas.core.dtypes.missing import isnull, notnull, remove_na_arraylike

# see gh-16971
from pandas.core.dtypes.missing import remove_na # noqa

from pandas.core.common import (is_bool_indexer,
_default_index,
_asarray_tuplesafe,
Expand Down
8 changes: 7 additions & 1 deletion pandas/tests/dtypes/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
from pandas.core.dtypes.dtypes import DatetimeTZDtype
from pandas.core.dtypes.missing import (
array_equivalent, isnull, notnull,
na_value_for_dtype)
na_value_for_dtype, remove_na)


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


def test_notnull():
Expand Down

0 comments on commit 8f85315

Please sign in to comment.