Skip to content

type dataframe.replace #1129

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

Merged
merged 7 commits into from
Feb 24, 2025
Merged

type dataframe.replace #1129

merged 7 commits into from
Feb 24, 2025

Conversation

MarcoGorelli
Copy link
Member

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

@MarcoGorelli MarcoGorelli marked this pull request as ready for review February 21, 2025 14:19
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

Aside from removing the deprecated limit and method arguments, can you make what is in series.pyi for Series.replace() have arguments that correspond (and tests)?

) = ...,
value: (
Scalar | NAType | Sequence[Scalar] | Mapping[Hashable, Scalar] | None
) = ...,
*,
inplace: Literal[True],
limit: int | None = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

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

limit is deprecated, so we should remove it.

| Pattern
| Sequence[str | Pattern]
| Mapping[Hashable, str | Pattern]
) = ...,
method: ReplaceMethod = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

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

method is deprecated so we should remove it

@MarcoGorelli MarcoGorelli marked this pull request as draft February 24, 2025 13:42
@MarcoGorelli MarcoGorelli changed the title type dataframe.replace WIP type dataframe.replace Feb 24, 2025
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

@MarcoGorelli this looks good to me. I'll merge it in when you change it from draft status. Ping me when that is done.

@MarcoGorelli MarcoGorelli marked this pull request as ready for review February 24, 2025 18:08
@MarcoGorelli MarcoGorelli changed the title WIP type dataframe.replace type dataframe.replace Feb 24, 2025
@MarcoGorelli
Copy link
Member Author

MarcoGorelli commented Feb 24, 2025

Thanks @Dr-Irv !

It was doing my head in trying to cover all the possibilities in all arguments so I made an alias ReplaceValue, is it alright?

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Feb 24, 2025

Thanks @Dr-Irv !

It was doing my head in trying to cover all the possibilities in all arguments so I made an alias ReplaceValue, is it alright?

Yes. Let me know when it's ready for review

@MarcoGorelli
Copy link
Member Author

Ready for review, thanks!

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

thanks @MarcoGorelli

@Dr-Irv Dr-Irv merged commit 25fe8aa into pandas-dev:main Feb 24, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants