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

get_by_label crash if not str #311

Closed
sygout opened this issue Dec 1, 2021 · 4 comments
Closed

get_by_label crash if not str #311

sygout opened this issue Dec 1, 2021 · 4 comments

Comments

@sygout
Copy link
Collaborator

sygout commented Dec 1, 2021

the function get_by_label does not check the type of the label provided. it then crashes if a float is provided

this case appeared because when reading from an Excel sheet the list of prefLabel, an empty cell is read as a float (NaN).

@francescalb
Copy link
Collaborator

Do you think we should check if label is str and return a TypeError if not?

@sygout
Copy link
Collaborator Author

sygout commented Dec 1, 2021

Yes it could be a first step.

Later I think that we should test if the submitted string is a valid label if there are rules for that.

@francescalb
Copy link
Collaborator

That we already do. If you ask for a label to does not exist it return NoSuchLabelError.

@francescalb
Copy link
Collaborator

closed with #312

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