Skip to content
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
1 change: 1 addition & 0 deletions doc/source/whatsnew/v3.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ Other Removals
- Removed the ``method`` keyword in ``ExtensionArray.fillna``, implement ``ExtensionArray._pad_or_backfill`` instead (:issue:`53621`)
- Removed the attribute ``dtypes`` from :class:`.DataFrameGroupBy` (:issue:`51997`)
- Enforced deprecation of ``argmin``, ``argmax``, ``idxmin``, and ``idxmax`` returning a result when ``skipna=False`` and an NA value is encountered or all values are NA values; these operations will now raise in such cases (:issue:`33941`, :issue:`51276`)
- Enforced deprecation of storage option "pyarrow_numpy" for :class:`StringDtype` (:issue:`60152`)
- Removed specifying ``include_groups=True`` in :class:`.DataFrameGroupBy.apply` and :class:`.Resampler.apply` (:issue:`7155`)

.. ---------------------------------------------------------------------------
Expand Down
18 changes: 0 additions & 18 deletions pandas/core/arrays/string_.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,6 @@ def __init__(
else:
storage = "python"

if storage == "pyarrow_numpy":
# TODO: Enforce in 3.0 (#60152)
warnings.warn(
"The 'pyarrow_numpy' storage option name is deprecated and will be "
'removed in pandas 3.0. Use \'pd.StringDtype(storage="pyarrow", '
"na_value=np.nan)' to construct the same dtype.\nOr enable the "
"'pd.options.future.infer_string = True' option globally and use "
'the "str" alias as a shorthand notation to specify a dtype '
'(instead of "string[pyarrow_numpy]").',
FutureWarning, # pdlint: ignore[warning_class]
stacklevel=find_stack_level(),
)
storage = "pyarrow"
na_value = np.nan

# validate options
if storage not in {"python", "pyarrow"}:
raise ValueError(
Expand Down Expand Up @@ -280,9 +265,6 @@ def construct_from_string(cls, string) -> Self:
return cls(storage="python")
elif string == "string[pyarrow]":
return cls(storage="pyarrow")
elif string == "string[pyarrow_numpy]":
# this is deprecated in the dtype __init__, remove this in pandas 3.0
return cls(storage="pyarrow_numpy")
else:
raise TypeError(f"Cannot construct a '{cls.__name__}' from '{string}'")

Expand Down
6 changes: 0 additions & 6 deletions pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,6 @@ def is_valid_string_storage(value: Any) -> None:
legal_values = ["auto", "python", "pyarrow"]
if value not in legal_values:
msg = "Value must be one of python|pyarrow"
if value == "pyarrow_numpy":
# TODO: we can remove extra message after 3.0
msg += (
". 'pyarrow_numpy' was specified, but this option should be "
"enabled using pandas.options.future.infer_string instead"
)
raise ValueError(msg)


Expand Down
8 changes: 0 additions & 8 deletions pandas/tests/arrays/string_/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ def string_dtype_highest_priority(dtype1, dtype2):
return DTYPE_HIERARCHY[max(h1, h2)]


def test_dtype_constructor():
pytest.importorskip("pyarrow")

with tm.assert_produces_warning(FutureWarning):
dtype = pd.StringDtype("pyarrow_numpy")
assert dtype == pd.StringDtype("pyarrow", na_value=np.nan)


def test_dtype_equality():
pytest.importorskip("pyarrow")

Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/extension/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ def test_eq_with_str(self, dtype):
# only the NA-variant supports parametrized string alias
assert dtype == f"string[{dtype.storage}]"
elif dtype.storage == "pyarrow":
with tm.assert_produces_warning(FutureWarning):
assert dtype == "string[pyarrow_numpy]"
assert dtype == "str"

def test_is_not_string_type(self, dtype):
# Different from BaseDtypeTests.test_is_not_string_type
Expand Down
Loading