Skip to content

Commit

Permalink
DEPR: Remove option use_inf_as null (#50030)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke authored Dec 3, 2022
1 parent de6a5cc commit 13b6b59
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v2.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ Removal of prior version deprecations/changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Removed deprecated :attr:`Timestamp.freq`, :attr:`Timestamp.freqstr` and argument ``freq`` from the :class:`Timestamp` constructor and :meth:`Timestamp.fromordinal` (:issue:`14146`)
- Removed deprecated :class:`CategoricalBlock`, :meth:`Block.is_categorical`, require datetime64 and timedelta64 values to be wrapped in :class:`DatetimeArray` or :class:`TimedeltaArray` before passing to :meth:`Block.make_block_same_class`, require ``DatetimeTZBlock.values`` to have the correct ndim when passing to the :class:`BlockManager` constructor, and removed the "fastpath" keyword from the :class:`SingleBlockManager` constructor (:issue:`40226`, :issue:`40571`)
- Removed deprecated global option ``use_inf_as_null`` in favor of ``use_inf_as_na`` (:issue:`17126`)
- Removed deprecated module ``pandas.core.index`` (:issue:`30193`)
- Removed deprecated alias ``pandas.core.tools.datetimes.to_time``, import the function directly from ``pandas.core.tools.times`` instead (:issue:`34145`)
- Removed deprecated :meth:`Categorical.to_dense`, use ``np.asarray(cat)`` instead (:issue:`32639`)
Expand Down
14 changes: 0 additions & 14 deletions pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,6 @@ def is_terminal() -> bool:
with cf.config_prefix("mode"):
cf.register_option("sim_interactive", False, tc_sim_interactive_doc)

use_inf_as_null_doc = """
: boolean
use_inf_as_null had been deprecated and will be removed in a future
version. Use `use_inf_as_na` instead.
"""

use_inf_as_na_doc = """
: boolean
True means treat None, NaN, INF, -INF as NA (old way),
Expand All @@ -483,14 +477,6 @@ def use_inf_as_na_cb(key) -> None:

with cf.config_prefix("mode"):
cf.register_option("use_inf_as_na", False, use_inf_as_na_doc, cb=use_inf_as_na_cb)
cf.register_option(
"use_inf_as_null", False, use_inf_as_null_doc, cb=use_inf_as_na_cb
)


cf.deprecate_option(
"mode.use_inf_as_null", msg=use_inf_as_null_doc, rkey="mode.use_inf_as_na"
)


data_manager_doc = """
Expand Down
14 changes: 0 additions & 14 deletions pandas/tests/series/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@ def test_isna_for_inf(self):
tm.assert_series_equal(r, e)
tm.assert_series_equal(dr, de)

@pytest.mark.parametrize(
"method, expected",
[
["isna", Series([False, True, True, False])],
["dropna", Series(["a", 1.0], index=[0, 3])],
],
)
def test_isnull_for_inf_deprecated(self, method, expected):
# gh-17115
s = Series(["a", np.inf, np.nan, 1.0])
with pd.option_context("mode.use_inf_as_null", True):
result = getattr(s, method)()
tm.assert_series_equal(result, expected)

def test_timedelta64_nan(self):

td = Series([timedelta(days=i) for i in range(10)])
Expand Down

0 comments on commit 13b6b59

Please sign in to comment.