Skip to content

[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

Merged
merged 3 commits into from
Dec 22, 2022

Conversation

kkim-labelbox
Copy link
Contributor

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

labels = project.label_generator()
label = next(labels)
assert label.data.media_attributes == {}
labels = project.label_generator().as_list()
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

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()`"
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

@msokoloff1 msokoloff1 left a 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.

@kkim-labelbox kkim-labelbox merged commit db81ff8 into develop Dec 22, 2022
@kkim-labelbox kkim-labelbox deleted the kkim/better-error-handling-label-creation branch December 22, 2022 20:10
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

Successfully merging this pull request may close these issues.

3 participants