DEPR (string): non-bool na for obj.str.contains by jbrockmendel · Pull Request #59615 · pandas-dev/pandas (original) (raw)
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
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.
I think startswith/endswith have the same issue? If so, can you add the same deprecation message there as well?
Sure, updated.
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?)
assuming we want to be consistent and also deprecate it for ArrowDtype, and not only for StringDtype?
Of course, that one already errors :)
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.
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 added a commit to jorisvandenbossche/pandas that referenced this pull request
Co-authored-by: Joris Van den Bossche jorisvandenbossche@gmail.com
jorisvandenbossche added a commit that referenced this pull request
Co-authored-by: Joris Van den Bossche jorisvandenbossche@gmail.com