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

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
@mroeschke mroeschke requested a review from jbrockmendel April 16, 2024 17:08
@@ -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

Copy link
Contributor

github-actions bot commented Jun 2, 2024

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jun 2, 2024
@mroeschke mroeschke removed the Stale label Jun 25, 2024
@mroeschke mroeschke added this to the 3.0 milestone Jun 25, 2024
@mroeschke mroeschke merged commit 009fe99 into pandas-dev:main Jun 25, 2024
44 checks passed
@mroeschke
Copy link
Member

Thanks for starting this @natmokval

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.

3 participants