-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
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
Conversation
pandas/tests/indexes/conftest.py
Outdated
|
||
|
||
all_indexes = [index for index in ([Index] + list(set(_get_subclasses(Index)))) | ||
if getattr(pd, index.__name__, None) is not None] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed that. thanks.
To exclude IntegerIndex and NumericIndex classes. But ci failed. so may
need rethink. the idea was to create a fixture that checks all registered
indexes for API checking. May just have to list them explicitly for now
…On Wed, 5 Jun 2019, 22:41 William Ayd, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pandas/tests/indexes/conftest.py
<#26677 (comment)>:
> @@ -47,3 +47,37 @@ def zero(request):
# For testing division by (or of) zero for Index with length 5, this
# gives several scalar-zeros and length-5 vector-zeros
return request.param
+
+
+def _get_subclasses(cls):
+ for subclass in cls.__subclasses__():
+ yield from _get_subclasses(subclass)
+ yield subclass
+
+
+all_indexes = [index for index in ([Index] + list(set(_get_subclasses(Index))))
+ if getattr(pd, index.__name__, None) is not None]
What is the name check for?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#26677?email_source=notifications&email_token=ADEMUXMUFATJ3BCOVTBNL6DPZAXI7A5CNFSM4HUE47D2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2W5INA#pullrequestreview-246273076>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADEMUXMV4FAGWFTTC36THYDPZAXI7ANCNFSM4HUE47DQ>
.
|
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@WillAyd the ci failures are now fixed. but could still parametrise |
There was a problem hiding this 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
pandas/tests/indexes/conftest.py
Outdated
|
||
|
||
all_indexes = [index for index in ([Index] + list(set(_get_subclasses(Index)))) | ||
if getattr(pd, index.__name__, None) is not None] |
There was a problem hiding this comment.
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)
pandas/tests/indexes/conftest.py
Outdated
return request.param | ||
|
||
|
||
@pytest.fixture |
There was a problem hiding this comment.
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?
thanks @simonjayhawkins |
#LondonPythonSprints
git diff upstream/master -u -- "*.py" | flake8 --diff