Skip to content

REGR: fixing Timestamp/Series subtraction, resolves #6648 #6657

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
Mar 18, 2014

Conversation

rosnfeld
Copy link
Contributor

closes #6648.

Admittedly the conditional in __sub__ is a little gross now.

I didn't add release notes as this is really just patching up a yet-to-be released item, but please let me know if I should.

Also, the test only runs on numpy >= 1.7, is that okay?

@jreback
Copy link
Contributor

jreback commented Mar 17, 2014

this looks fine.

can you do a quick perf check?

@jreback jreback added this to the 0.14.0 milestone Mar 17, 2014
@rosnfeld
Copy link
Contributor Author

Perf test is clean.

return datetime.__sub__(self, other)
if is_timedelta64_object(other) or is_integer_object(other) \
or isinstance(other, timedelta) or hasattr(other, 'delta'):
neg_other = -other
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of isinstance use is_timedelta_object
what has a delta attribute?

Copy link
Contributor

Choose a reason for hiding this comment

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

actually the isinstance is ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I am just trying to copy the instance checks already in the __add__ code.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh ok that's fine then

jreback added a commit that referenced this pull request Mar 18, 2014
REGR: fixing Timestamp/Series subtraction, resolves #6648
@jreback jreback merged commit 2e13849 into pandas-dev:master Mar 18, 2014
@jreback
Copy link
Contributor

jreback commented Mar 18, 2014

thanks!

@rosnfeld rosnfeld deleted the issue_6648 branch March 18, 2014 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Dtype Conversions Unexpected or buggy dtype conversions Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REGR: Timestamp - series is failing
2 participants