-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
REF: handle searchsorted casting within DatetimeLikeArray #30950
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
Conversation
There was a problem hiding this comment.
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?
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 |
https://dev.pandas.io/docs/reference/api/pandas.array.html has examples on how to construct these. |
There was a problem hiding this comment.
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 <[email protected]>
ping |
raise TypeError( | ||
"searchsorted requires compatible dtype or scalar, " | ||
f"not {type(value).__name__}" | ||
) | ||
if isinstance(value, Index): |
There was a problem hiding this comment.
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?)
thanks |
No description provided.