Skip to content

CLN: dont special-case DatetimeArray indexing #36654

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 8 commits into from
Oct 12, 2020

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Sep 26, 2020

cc @jorisvandenbossche

@jreback jreback added Indexing Related to indexing on series/frames, not to indexes themselves Datetime Datetime data dtype labels Oct 2, 2020
@jreback
Copy link
Contributor

jreback commented Oct 2, 2020

can you add some tests that lock this down (eg from the OP).

I think this would be ok to push for 1.2 with a whatsnew note.

cc @jorisvandenbossche

@jbrockmendel
Copy link
Member Author

whatsnew+test+green

@jbrockmendel
Copy link
Member Author

any other thoughts here? after this i can get back to de-duplicating EA code

def test_getitem_boolean_dt64_copies():
# GH#36210
dti = date_range("2016-01-01", periods=4, tz="US/Pacific")
key = np.array([True, True, False, False])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you replicate the OP here as well (e.g. add the slice test for this too)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure i understand. this is exactly the example from the OP

Copy link
Contributor

@jreback jreback Oct 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the OP had 2 example inputs

ser1 = pd.Series(dti._data)
ser2 = pd.Series(range(4))

@jreback jreback added this to the 1.2 milestone Oct 11, 2020
@jbrockmendel
Copy link
Member Author

Test amended + green

@jreback jreback merged commit 4d3b197 into pandas-dev:master Oct 12, 2020
@jbrockmendel jbrockmendel deleted the dtlike-no-slice branch October 12, 2020 02:10
@jorisvandenbossche
Copy link
Member

Thanks Brock!

JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Oct 26, 2020
* CLN: dont special-case DatetimeArray indexing

* use parent class _validate_getitem_key

* test, whatsnew

* update test
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
* CLN: dont special-case DatetimeArray indexing

* use parent class _validate_getitem_key

* test, whatsnew

* update test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API/DEPR: casting bool-indexer to slice in dt64/td64/period
3 participants