Skip to content

Commit 13b6b59

Browse files
authored
DEPR: Remove option use_inf_as null (#50030)
1 parent de6a5cc commit 13b6b59

File tree

3 files changed

+1
-28
lines changed

3 files changed

+1
-28
lines changed

doc/source/whatsnew/v2.0.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ Removal of prior version deprecations/changes
386386
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
387387
- Removed deprecated :attr:`Timestamp.freq`, :attr:`Timestamp.freqstr` and argument ``freq`` from the :class:`Timestamp` constructor and :meth:`Timestamp.fromordinal` (:issue:`14146`)
388388
- 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`)
389+
- Removed deprecated global option ``use_inf_as_null`` in favor of ``use_inf_as_na`` (:issue:`17126`)
389390
- Removed deprecated module ``pandas.core.index`` (:issue:`30193`)
390391
- Removed deprecated alias ``pandas.core.tools.datetimes.to_time``, import the function directly from ``pandas.core.tools.times`` instead (:issue:`34145`)
391392
- Removed deprecated :meth:`Categorical.to_dense`, use ``np.asarray(cat)`` instead (:issue:`32639`)

pandas/core/config_init.py

-14
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,6 @@ def is_terminal() -> bool:
458458
with cf.config_prefix("mode"):
459459
cf.register_option("sim_interactive", False, tc_sim_interactive_doc)
460460

461-
use_inf_as_null_doc = """
462-
: boolean
463-
use_inf_as_null had been deprecated and will be removed in a future
464-
version. Use `use_inf_as_na` instead.
465-
"""
466-
467461
use_inf_as_na_doc = """
468462
: boolean
469463
True means treat None, NaN, INF, -INF as NA (old way),
@@ -483,14 +477,6 @@ def use_inf_as_na_cb(key) -> None:
483477

484478
with cf.config_prefix("mode"):
485479
cf.register_option("use_inf_as_na", False, use_inf_as_na_doc, cb=use_inf_as_na_cb)
486-
cf.register_option(
487-
"use_inf_as_null", False, use_inf_as_null_doc, cb=use_inf_as_na_cb
488-
)
489-
490-
491-
cf.deprecate_option(
492-
"mode.use_inf_as_null", msg=use_inf_as_null_doc, rkey="mode.use_inf_as_na"
493-
)
494480

495481

496482
data_manager_doc = """

pandas/tests/series/test_missing.py

-14
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,6 @@ def test_isna_for_inf(self):
3636
tm.assert_series_equal(r, e)
3737
tm.assert_series_equal(dr, de)
3838

39-
@pytest.mark.parametrize(
40-
"method, expected",
41-
[
42-
["isna", Series([False, True, True, False])],
43-
["dropna", Series(["a", 1.0], index=[0, 3])],
44-
],
45-
)
46-
def test_isnull_for_inf_deprecated(self, method, expected):
47-
# gh-17115
48-
s = Series(["a", np.inf, np.nan, 1.0])
49-
with pd.option_context("mode.use_inf_as_null", True):
50-
result = getattr(s, method)()
51-
tm.assert_series_equal(result, expected)
52-
5339
def test_timedelta64_nan(self):
5440

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

0 commit comments

Comments
 (0)