Skip to content

ENH/BUG: consistently cast strs to datetimelike for searchsorted #36346

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
Sep 17, 2020

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Sep 13, 2020

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

ATM we are pretty inconsistent in how we handle strings for (DTI|TDI|PI|Series).searchsorted. The underlying EAs will cast scalar strings but not Sequene[str]. The Indexes will raise on both scalars and sequences. Series follows the EA and casts "2016-01-01" but not ["2016-01-01"].

This makes us consistently cast in all cases.

@jreback jreback added the ExtensionArray Extending pandas with custom dtypes or arrays. label Sep 13, 2020
@jreback jreback added this to the 1.2 milestone Sep 13, 2020
@jreback
Copy link
Contributor

jreback commented Sep 13, 2020

sure, i guess need a whatsnew for this

@jbrockmendel
Copy link
Member Author

whatsnew added + green

@jreback jreback merged commit b162caf into pandas-dev:master Sep 17, 2020
@jreback
Copy link
Contributor

jreback commented Sep 17, 2020

sure

@jbrockmendel
Copy link
Member Author

FYI im planning PRs to make cast_str=True in all of the validator method in that file for internal consistency (and ideally to end up with fewer methods)

@jbrockmendel jbrockmendel deleted the unify-validators-searchsorted branch September 17, 2020 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants