Skip to content

BUG: .isin on datetimelike indexes do not validate input of level parameter #26677

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 10 commits into from
Jun 9, 2019

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins commented Jun 5, 2019

#LondonPythonSprints

@simonjayhawkins simonjayhawkins added Index Related to the Index class or subclasses Datetime Datetime data dtype labels Jun 5, 2019


all_indexes = [index for index in ([Index] + list(set(_get_subclasses(Index))))
if getattr(pd, index.__name__, None) is not None]
Copy link
Member

Choose a reason for hiding this comment

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

What is the name check for?

Copy link
Member

Choose a reason for hiding this comment

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

Can just simplify to if getattr(pd, index.__name__, False)

Copy link
Member Author

Choose a reason for hiding this comment

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

missed that. thanks.

@simonjayhawkins
Copy link
Member Author

simonjayhawkins commented Jun 5, 2019 via email

@simonjayhawkins simonjayhawkins changed the title BUG: .isin on datetimelike indexes do validate input of level parameter BUG: .isin on datetimelike indexes do not validate input of level parameter Jun 6, 2019
@codecov
Copy link

codecov bot commented Jun 6, 2019

Codecov Report

Merging #26677 into master will decrease coverage by 50.1%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #26677       +/-   ##
===========================================
- Coverage   91.88%   41.78%   -50.11%     
===========================================
  Files         174      174               
  Lines       50694    50665       -29     
===========================================
- Hits        46581    21169    -25412     
- Misses       4113    29496    +25383
Flag Coverage Δ
#multiple ?
#single 41.78% <50%> (-0.21%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/datetimelike.py 56.61% <50%> (-41.53%) ⬇️
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
pandas/core/groupby/categorical.py 0% <0%> (-100%) ⬇️
pandas/tseries/plotting.py 0% <0%> (-100%) ⬇️
pandas/tseries/converter.py 0% <0%> (-100%) ⬇️
pandas/io/formats/html.py 0% <0%> (-99.37%) ⬇️
pandas/io/sas/sas7bdat.py 0% <0%> (-91.16%) ⬇️
pandas/io/sas/sas_xport.py 0% <0%> (-90.1%) ⬇️
pandas/core/sparse/scipy_sparse.py 10.14% <0%> (-89.86%) ⬇️
... and 129 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 c9c6c22...1c88839. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 6, 2019

Codecov Report

Merging #26677 into master will increase coverage by 1.4%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #26677     +/-   ##
=========================================
+ Coverage    90.3%    91.7%   +1.4%     
=========================================
  Files         179      179             
  Lines       50747    50749      +2     
=========================================
+ Hits        45826    46540    +714     
+ Misses       4921     4209    -712
Flag Coverage Δ
#multiple 90.3% <100%> (ø) ⬆️
#single 41.22% <50%> (?)
Impacted Files Coverage Δ
pandas/core/indexes/datetimelike.py 98.14% <100%> (ø) ⬆️
pandas/core/arrays/categorical.py 95.92% <0%> (+0.12%) ⬆️
pandas/core/indexes/datetimes.py 96.37% <0%> (+0.16%) ⬆️
pandas/io/formats/printing.py 85.56% <0%> (+1.06%) ⬆️
pandas/io/clipboard/clipboards.py 34.78% <0%> (+2.89%) ⬆️
pandas/core/computation/expr.py 97.52% <0%> (+3.02%) ⬆️
pandas/core/computation/common.py 89.47% <0%> (+5.26%) ⬆️
pandas/io/pytables.py 90.29% <0%> (+26.47%) ⬆️
pandas/core/computation/pytables.py 90.24% <0%> (+27.74%) ⬆️

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 a387110...84e8cc4. Read the comment docs.

@simonjayhawkins
Copy link
Member Author

@WillAyd the ci failures are now fixed. but could still parametrise all_index_empty directly for now and decompose later as required, if it makes the code clearer.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Minor stylistic nit but otherwise lgtm



all_indexes = [index for index in ([Index] + list(set(_get_subclasses(Index))))
if getattr(pd, index.__name__, None) is not None]
Copy link
Member

Choose a reason for hiding this comment

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

Can just simplify to if getattr(pd, index.__name__, False)

@WillAyd WillAyd added this to the 0.25.0 milestone Jun 6, 2019
return request.param


@pytest.fixture
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this just work off of the indices_list? why creating extra machinery here?

@jreback jreback merged commit 0f3e8e8 into pandas-dev:master Jun 9, 2019
@jreback
Copy link
Contributor

jreback commented Jun 9, 2019

thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the isin-datetimelike branch June 10, 2019 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Index Related to the Index class or subclasses
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: .isin on datetimelike indexes do not validate input of level parameter
3 participants