-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
ERR: invalid input to .str.replace does not raise #13438
Comments
It's not only None that gives non-sensical output, also eg numerical values:
So rather than checking for None, maybe just check that the replacement is string-like? |
Gotcha, is the following output valid:
|
Hmm, not sure about that one. At first, it seems invalid as well, but this is the standard behaviour of
|
I think it makes more sense to consider this as valid, since that's how str.replace works. Also it would make sense to throw TypeError instead of ValueError:
|
This should raise;
None
is not an allowed option for the replacement.cc @Kwsmith
The text was updated successfully, but these errors were encountered: