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

DEPR (string): non-bool na for obj.str.contains #59615

Merged
merged 4 commits into from
Aug 31, 2024

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Aug 26, 2024

No 2.3 whatsnew file yet. Not sure if the plan is to introduce one in #59513

@jorisvandenbossche
Copy link
Member

I think startswith/endswith have the same issue? If so, can you add the same deprecation message there as well?

No 2.3 whatsnew file yet. Not sure if the plan is to introduce one in #59513

Yeah, we should start a 2.3 whatsnew file. We should add it to main, though (not in the backport PR), so things can be added to that file in PRs like this one.

@jorisvandenbossche jorisvandenbossche added Strings String extension data type and string data Deprecate Functionality to remove in pandas labels Aug 27, 2024
@jorisvandenbossche jorisvandenbossche added this to the 2.3 milestone Aug 27, 2024
@jbrockmendel
Copy link
Member Author

I think startswith/endswith have the same issue? If so, can you add the same deprecation message there as well?

Sure, updated.

@jorisvandenbossche
Copy link
Member

Actually, you could maybe move the warning to core/string/accessors.py, then you don't have to repeat it for the various implementations, and then also ArrowDtype(string) will get it (assuming we want to be consistent and also deprecate it for ArrowDtype, and not only for StringDtype?)

@jorisvandenbossche
Copy link
Member

assuming we want to be consistent and also deprecate it for ArrowDtype, and not only for StringDtype?

Of course, that one already errors :)

@jbrockmendel
Copy link
Member Author

then you don't have to repeat it for the various implementations

Because it already errors for the ArrowEA version (but with a pyarrow exception), patching it in the StringAccessor method would be bulky. I think the thing to do is wait until the deprecation is enforced, then do the validation in the StringAccessor method and get consistent exception/message.

@jorisvandenbossche
Copy link
Member

Because it already errors for the ArrowEA version (but with a pyarrow exception), patching it in the StringAccessor method would be bulky. I think the thing to do is wait until the deprecation is enforced, then do the validation in the StringAccessor method and get consistent exception/message.

Sounds good!

@jorisvandenbossche jorisvandenbossche merged commit c345ffd into pandas-dev:main Aug 31, 2024
35 of 40 checks passed
@jbrockmendel jbrockmendel deleted the depr-contains-na branch September 1, 2024 01:47
jorisvandenbossche added a commit to jorisvandenbossche/pandas that referenced this pull request Oct 10, 2024
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
jorisvandenbossche added a commit that referenced this pull request Oct 10, 2024
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Deprecate Functionality to remove in pandas Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: .str.contains na validation
2 participants