Skip to content

REF: stop allowing iNaT in TimedeltaBlock methods #27411

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 1 commit into from
Jul 22, 2019

Conversation

jbrockmendel
Copy link
Member

Working towards minimizing the amount of special-casing we do within internals


# Note: we have to do do `astype` and not view because in general we
# have float result at this point, not i8
return result.astype(values.dtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

why are you not letting this then fall thru, e.g. if there is masking here?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we just return result here, at this point it is in general float64. In the calling function we're going to do a result.view(values.dtype), which will be incorrect

Copy link
Contributor

Choose a reason for hiding this comment

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

right my point is to do this later in the function after masking and checking for 0-len.

Copy link
Member Author

Choose a reason for hiding this comment

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

just tried that, breaks because it ends up double-masking

Copy link
Member Author

Choose a reason for hiding this comment

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

i wouldnt hang up on this too much, since we're going to have to move this to earlier in the call stack in #27428

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, if you can clean this up later would be great.

@jreback jreback added Compat pandas objects compatability with Numpy or Python functions Timedelta Timedelta data type labels Jul 16, 2019
@jreback jreback added this to the 1.0 milestone Jul 20, 2019

# Note: we have to do do `astype` and not view because in general we
# have float result at this point, not i8
return result.astype(values.dtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

right my point is to do this later in the function after masking and checking for 0-len.

@jbrockmendel
Copy link
Member Author

gentle ping; this is a blocker for some pretty nice internals simplification

@TomAugspurger
Copy link
Contributor

Seems reasonable to me.

@jreback jreback merged commit 2d2d670 into pandas-dev:master Jul 22, 2019
@jbrockmendel jbrockmendel deleted the inat branch July 22, 2019 21:31
quintusdias pushed a commit to quintusdias/pandas_dev that referenced this pull request Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants