REF: handle searchsorted casting within DatetimeLikeArray by jbrockmendel · Pull Request #30950 · pandas-dev/pandas (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
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 }})
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jbrockmendel . I think changing exception types and error messages should have a whatsnew. also in the case of Exception type, I would regard a change as a breaking change. not sure what others think. Should we have a deprecation for this?
I think changing exception types and error messages should have a whatsnew. also in the case of Exception type, I would regard a change as a breaking change. not sure what others think. Should we have a deprecation for this?
If it were on the Index subclasses I would agree, but for the DTA/TDA/PA (which we dont expect users to use directly) I think we're OK
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @simonjayhawkins we should have a whatsnew note, but its a very minor change IMHO. otherwise lgtm. ping on green.
I think after this PR you can then share the common code in searchsorted (at least for Index).
Co-Authored-By: Simon Hawkins simonjayhawkins@gmail.com
raise TypeError( |
---|
"searchsorted requires compatible dtype or scalar, " |
f"not {type(value).__name__}" |
) |
if isinstance(value, Index): |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can likely move this to the base class an use shared impl with Timedelta (and I guess with DTI?)
Labels
Related to the Index class or subclasses
Internal refactoring of code