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: .isin on datetimelike indexes do not validate input of level parameter #26675

Closed
simonjayhawkins opened this issue Jun 5, 2019 · 0 comments · Fixed by #26677
Closed
Labels
Datetime Datetime data dtype Index Related to the Index class or subclasses
Milestone

Comments

@simonjayhawkins
Copy link
Member

Code Sample, a copy-pastable example if possible

index = pd.DatetimeIndex([], name='foo')
index.isin([], level='foobar')

Problem description

on master:

array([], dtype=bool)

on 0.23.4

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-82f8aeda6721> in <module>
      1 index = pd.DatetimeIndex([], name='foo')
----> 2 index.isin([], level='foobar')

TypeError: isin() got an unexpected keyword argument 'level'

Expected Output

to validate input and raise same message as other non-datetimelike indexes

KeyError: 'Level foobar must be same as name (foo)'

the api for isin is defined in #7892

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]

@simonjayhawkins simonjayhawkins added Index Related to the Index class or subclasses Datetime Datetime data dtype labels Jun 5, 2019
@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
@jreback jreback added this to the 0.25.0 milestone Jun 8, 2019
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 a pull request may close this issue.

2 participants