Skip to content

BUG: IntervalIndex.putmask with datetimelike dtypes #37968

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 18 commits into from
Nov 20, 2020

Conversation

jbrockmendel
Copy link
Member

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

Implements NDArrayBackedExtensionArray.putmask which will hopefully be rolled into __array_function__ to simplify a bunch of code.

@jreback jreback added Bug Interval Interval data type Datetime Datetime data dtype labels Nov 20, 2020
@jreback jreback added this to the 1.2 milestone Nov 20, 2020
@jreback jreback merged commit fc92c6e into pandas-dev:master Nov 20, 2020
@jbrockmendel jbrockmendel deleted the bug-whereput branch November 20, 2020 03:16
try:
value = self._data._validate_setitem_value(value)
res_values.putmask(mask, value)
Copy link
Member

Choose a reason for hiding this comment

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

self._data is defined as _data: ExtensionArray

Is ExtensionIndex only for ndarray backed ExtensionArray? or maybe will need catch AttributeError also eventually?

see also #35032 (comment) (sort of related).

Copy link
Member

Choose a reason for hiding this comment

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

Ah my bad for not checking the code thoroughly before commenting and just looking at the diff.

I wasn't aware that you recently added a NDArrayBackedExtensionIndex.

Doesn't this add more complexity? what is the motivation for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't this add more complexity? what is the motivation for this?

Its just taking methods that are duplicated in CategoricalIndex+DatetimeIndexOpsMixin and putting them in one place. I guess you could say that "adds complexity" bc there is an additional step in the inheritance chain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Interval Interval data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants