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

Fix+test DTI/TDI/PI add/sub with ndarray[datetime64/timedelta64] #19847

Merged
merged 7 commits into from Feb 25, 2018

Conversation

Projects
None yet
3 participants
@jbrockmendel
Member

jbrockmendel commented Feb 22, 2018

Two notes for upcoming passes:

  • the tests are pretty redundant, can be parametrized more tightly once they are all OK.
  • catching ndarray[datetime64] separately from DatetimeIndex is kind of weird, but for the moment necesarry. Once #19835 goes through and re-orders the catching, we'll be able to fix this.
@gfyoung

This comment has been minimized.

Member

gfyoung commented Feb 23, 2018

@jbrockmendel : Good direction so far! Looks you can parametrize now since all the CI is green.

if is_datetime64_dtype(other) and is_timedelta64_dtype(self):
# ndarray[datetime64] cannot be subtracted from self, so
# we need to wrap in DatetimeIndex and flip the operation
from pandas.core.indexes.datetimes import DatetimeIndex

This comment has been minimized.

@jreback

jreback Feb 23, 2018

Contributor

since inside a function, can just import from pandas directrly

This comment has been minimized.

@jreback

jreback Feb 23, 2018

Contributor

atually pls change all imports that are inside functions to do this (its just shorter)

@codecov

This comment has been minimized.

codecov bot commented Feb 23, 2018

Codecov Report

❗️ No coverage uploaded for pull request base (master@e97be6f). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #19847   +/-   ##
=========================================
  Coverage          ?   91.69%           
=========================================
  Files             ?      150           
  Lines             ?    48920           
  Branches          ?        0           
=========================================
  Hits              ?    44857           
  Misses            ?     4063           
  Partials          ?        0
Flag Coverage Δ
#multiple 90.07% <100%> (?)
#single 41.82% <8.33%> (?)
Impacted Files Coverage Δ
pandas/core/indexes/timedeltas.py 90.99% <100%> (ø)
pandas/core/indexes/datetimelike.py 97.38% <100%> (ø)

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 e97be6f...dc67762. Read the comment docs.

@jbrockmendel jbrockmendel referenced this pull request Feb 23, 2018

Open

ExtensionArray meta-issue #19696

12 of 15 tasks complete
@jreback

This comment has been minimized.

Contributor

jreback commented Feb 24, 2018

needs a rebase. does this fix any open issue?

@jbrockmendel

This comment has been minimized.

Member

jbrockmendel commented Feb 24, 2018

does this fix any open issue?

Not that I'm aware of.

@jreback

this needs a whatsnew note to show what is a bug fix / enhancement / api change (IOW what works now that didn't work before)

# -------------------------------------------------------------
# __add__/__sub__ with ndarray[datetime64] and ndarray[timedelta64]
def test_dti_add_dt64_array_raises(self, tz):

This comment has been minimized.

@jreback

jreback Feb 24, 2018

Contributor

these tests don't exist already? odd

@jbrockmendel

This comment has been minimized.

Member

jbrockmendel commented Feb 24, 2018

Here too Travis error is pyarrow import

@jreback jreback added this to the 0.23.0 milestone Feb 25, 2018

@jreback jreback merged commit 5a87765 into pandas-dev:master Feb 25, 2018

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@jreback

This comment has been minimized.

Contributor

jreback commented Feb 25, 2018

thanks

@jbrockmendel jbrockmendel deleted the jbrockmendel:dtlike4 branch Jun 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment