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/TST: Fix TimedeltaIndex comparisons with invalid types #24056

Merged
merged 12 commits into from Dec 5, 2018

Conversation

Projects
None yet
3 participants
@jbrockmendel
Copy link
Member

commented Dec 2, 2018

Parametrize a handful of tests.

  • closes #23063
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry
@pep8speaks

This comment has been minimized.

Copy link

commented Dec 2, 2018

Hello @jbrockmendel! Thanks for submitting the PR.

if not hasattr(values, "dtype"):
if np.ndim(values) == 0:
# i.e. iterator
values = list(values)

This comment has been minimized.

Copy link
@jreback

jreback Dec 3, 2018

Contributor

you have a test hit this?

This comment has been minimized.

Copy link
@jbrockmendel

jbrockmendel Dec 3, 2018

Author Member

Yes

@@ -1115,7 +1115,7 @@ def dispatch_to_series(left, right, func, str_rep=None, axis=None):
import pandas.core.computation.expressions as expressions

right = lib.item_from_zerodim(right)
if lib.is_scalar(right):
if lib.is_scalar(right) or np.ndim(right) == 0:

This comment has been minimized.

Copy link
@jreback

jreback Dec 3, 2018

Contributor

why is this needed? this should already be handled by is_scalar

This comment has been minimized.

Copy link
@jbrockmendel

jbrockmendel Dec 3, 2018

Author Member

because there are lots of weird things a user could pass that are zero-dim but not caught by is_scalar. The test case that hits this just passes object()

@codecov

This comment has been minimized.

Copy link

commented Dec 3, 2018

Codecov Report

Merging #24056 into master will increase coverage by 0.05%.
The diff coverage is 47.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24056      +/-   ##
==========================================
+ Coverage   42.38%   42.44%   +0.05%     
==========================================
  Files         161      161              
  Lines       51701    51573     -128     
==========================================
- Hits        21914    21890      -24     
+ Misses      29787    29683     -104
Flag Coverage Δ
#single 42.44% <47.05%> (+0.05%) ⬆️
Impacted Files Coverage Δ
pandas/util/testing.py 51.71% <0%> (-0.1%) ⬇️
pandas/core/ops.py 55.2% <100%> (ø) ⬆️
pandas/core/generic.py 39.36% <100%> (+0.02%) ⬆️
pandas/core/arrays/datetimes.py 63.17% <40%> (-0.62%) ⬇️
pandas/core/arrays/timedeltas.py 50.14% <50%> (+11.17%) ⬆️
pandas/core/indexes/period.py 39.82% <0%> (-1.03%) ⬇️
pandas/core/indexes/timedeltas.py 39.82% <0%> (-1.02%) ⬇️
pandas/core/dtypes/common.py 69.9% <0%> (-0.5%) ⬇️
pandas/core/indexes/datetimes.py 52.18% <0%> (-0.14%) ⬇️
pandas/core/arrays/integer.py 37.97% <0%> (-0.09%) ⬇️
... and 23 more

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 08395af...9df94d9. Read the comment docs.

@codecov

This comment has been minimized.

Copy link

commented Dec 3, 2018

Codecov Report

Merging #24056 into master will decrease coverage by <.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24056      +/-   ##
==========================================
- Coverage   92.21%    92.2%   -0.01%     
==========================================
  Files         161      161              
  Lines       51684    51696      +12     
==========================================
+ Hits        47658    47667       +9     
- Misses       4026     4029       +3
Flag Coverage Δ
#multiple 90.6% <83.33%> (-0.01%) ⬇️
#single 43% <50%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 87.41% <100%> (+0.02%) ⬆️
pandas/core/ops.py 94.13% <100%> (ø) ⬆️
pandas/core/generic.py 96.65% <100%> (ø) ⬆️
pandas/core/arrays/timedeltas.py 87.27% <77.77%> (-0.34%) ⬇️
pandas/core/arrays/datetimes.py 98.25% <80%> (-0.18%) ⬇️

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 4b5f4d1...9b02f5d. Read the comment docs.

jbrockmendel added some commits Dec 3, 2018

@jreback jreback added this to the 0.24.0 milestone Dec 5, 2018

@jreback

jreback approved these changes Dec 5, 2018

@jreback jreback merged commit 6919013 into pandas-dev:master Dec 5, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
pandas-dev.pandas Build #20181205.10 succeeded
Details
@jreback

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2018

thanks!

@jbrockmendel jbrockmendel deleted the jbrockmendel:pre-fixes7 branch Dec 5, 2018

Pingviinituutti added a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019

Pingviinituutti added a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.