Skip to content
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

BUG: Fix tz-aware DatetimeIndex +/- TimedeltaIndex/timedelta64 array #18653

Merged
merged 2 commits into from
Dec 7, 2017

Conversation

jschendel
Copy link
Member

Added the whatsnew entry under 0.22.0, but could possibly go under 0.21.1. This PR is a prereq for #18558.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

let's keep under 0.22

tdi = pd.timedelta_range('0 days', periods=10)
expected = pd.date_range('2017-01-01', periods=10, tz=tz)

result = dti + tdi
Copy link
Contributor

Choose a reason for hiding this comment

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

also test a reverse add

Copy link
Member Author

Choose a reason for hiding this comment

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

done

tdi = pd.timedelta_range('0 days', periods=10)
expected = pd.date_range('2017-01-01', periods=10, tz=tz, freq='-1D')

result = dti - tdi
Copy link
Contributor

Choose a reason for hiding this comment

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

test that the reverse ops raise

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@jreback jreback added Bug Timedelta Timedelta data type Datetime Datetime data dtype Timezones Timezone data dtype labels Dec 6, 2017
@codecov
Copy link

codecov bot commented Dec 6, 2017

Codecov Report

Merging #18653 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18653      +/-   ##
==========================================
- Coverage   91.59%   91.57%   -0.02%     
==========================================
  Files         153      153              
  Lines       51221    51223       +2     
==========================================
- Hits        46917    46909       -8     
- Misses       4304     4314      +10
Flag Coverage Δ
#multiple 89.44% <100%> (-0.01%) ⬇️
#single 40.67% <0%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/datetimes.py 95.6% <100%> (-0.09%) ⬇️
pandas/core/indexes/datetimelike.py 97.13% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13f6267...cc6b19b. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 6, 2017

Codecov Report

Merging #18653 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18653      +/-   ##
==========================================
+ Coverage   91.57%   91.57%   +<.01%     
==========================================
  Files         153      153              
  Lines       51210    51212       +2     
==========================================
+ Hits        46894    46899       +5     
+ Misses       4316     4313       -3
Flag Coverage Δ
#multiple 89.43% <100%> (+0.02%) ⬆️
#single 40.67% <0%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/datetimelike.py 97.13% <100%> (ø) ⬆️
pandas/core/indexes/datetimes.py 95.68% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️
pandas/plotting/_converter.py 65.25% <0%> (+1.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdba133...2a665c0. Read the comment docs.

@jreback jreback added this to the 0.22.0 milestone Dec 7, 2017
@jreback jreback merged commit 15ad542 into pandas-dev:master Dec 7, 2017
@jreback
Copy link
Contributor

jreback commented Dec 7, 2017

thanks @jschendel

very nice; keep em coming!

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

Successfully merging this pull request may close these issues.

BUG: tz-aware DatetimeIndex + array(timedelta) gives incorrect result
2 participants