-
Notifications
You must be signed in to change notification settings - Fork 68
[AL-0] Better error handling for label creation during test #812
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
[AL-0] Better error handling for label creation during test #812
Conversation
labels = project.label_generator() | ||
label = next(labels) | ||
assert label.data.media_attributes == {} | ||
labels = project.label_generator().as_list() |
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.
you can also just call list(project.label_generator()). It makes it more readable.
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.
or even
labels = [project.label_generator().get_one()]
to be consistent with the other test
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.
ah, len([None]) == 1, forget my comment )
labels = project.label_generator().as_list() | ||
assert len( | ||
labels | ||
) == 1, "Labels could not be fetched via `project.label_generator()`" |
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.
I am already imagining this error message being posted all over slack. This makes it seem like the problem is the sdk. I would say that label export job unexpectedly returned an empty result set.
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.
Thanks for the suggestions! Made the changes
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.
Just left some nits. Feel free to ignore.
Fixed two places where we were using a Generator to verify existence of the label, which was resulting in an error message that was hard to decipher