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

Filter by level does not work with multiple conditions #712

Open
Rlamboll opened this issue Dec 1, 2022 · 1 comment
Open

Filter by level does not work with multiple conditions #712

Rlamboll opened this issue Dec 1, 2022 · 1 comment

Comments

@Rlamboll
Copy link
Collaborator

Rlamboll commented Dec 1, 2022

As far as I can work out,
"df.filter(level=[1, 2])"
always produces nothing, even when
"df.filter(level=1)" and "df.filter(level=2)"
produce reasonable values. I have been using workarounds so far, but at some point we should probably fix this!

@danielhuppmann
Copy link
Member

The level argument is passed to

def find_depth(data, s="", level=None):

And the docstring of the function clearly states that it can be an int or a str (like 1+).

Fine for me to either extend the function or raise an explicit error.

Also, we should add level to the list of illegal column names in an IamDataFrame. Using an extra-column named level would cause unexpected behavior for the filter method.

ILLEGAL_COLS = ["data", "meta"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants