Skip to content

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

Merged
merged 4 commits into from
Jan 18, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.

Copy link
Member

@simonjayhawkins simonjayhawkins left a 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?

@simonjayhawkins simonjayhawkins added Refactor Internal refactoring of code Index Related to the Index class or subclasses labels Jan 13, 2020
@jbrockmendel
Copy link
Member Author

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

@simonjayhawkins
Copy link
Member

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.

Copy link
Contributor

@jreback jreback left a 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).

@jbrockmendel
Copy link
Member Author

ping

raise TypeError(
"searchsorted requires compatible dtype or scalar, "
f"not {type(value).__name__}"
)
if isinstance(value, Index):
Copy link
Contributor

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?)

@jreback jreback merged commit 024925a into pandas-dev:master Jan 18, 2020
@jreback
Copy link
Contributor

jreback commented Jan 18, 2020

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Index Related to the Index class or subclasses Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants