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

CLN: enforce deprecation of the Series[categorical].replace special-casing #58270

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

natmokval
Copy link
Contributor

@natmokval natmokval commented Apr 15, 2024

xref #56385

enforced deprecation of the behavior of DataFrame.replace and Series.replace with CategoricalDtype

@natmokval natmokval changed the title CLN: enforce deprecation the of Series[categorical].replace special-casing CLN: enforce deprecation of the Series[categorical].replace special-casing Apr 15, 2024
@natmokval natmokval added Clean Categorical Categorical Data Type replace replace method labels Apr 16, 2024
@natmokval natmokval marked this pull request as ready for review April 16, 2024 13:42
@@ -2680,15 +2680,9 @@ def _replace(self, *, to_replace, value, inplace: bool = False) -> Self | None:
NDArrayBacked.__init__(cat, new_codes, new_dtype)

if new_dtype != orig_dtype:
warnings.warn(
# GH#55147
raise TypeError(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this method called anywhere? i think it can just be removed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is special-casing in internals.blocks that calls this method. that special-casing needs to be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Clean replace replace method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants