-
Notifications
You must be signed in to change notification settings - Fork 68
[AL-2290] Add result field to Task and get_result() #585
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
Conversation
labelbox/schema/task.py
Outdated
response = requests.get(self.result) | ||
response.raise_for_status() | ||
return response.text | ||
return "" |
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.
it might be good to return None vs an empty string. That way an empty response is clearly different from a result that doesn't exist.
labelbox/schema/task.py
Outdated
if self.result: | ||
response = requests.get(self.result) | ||
response.raise_for_status() | ||
return response.text |
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.
Should this return some sort of json? We are going to have to support some sort of schema here which is why we were waiting to add this feature. Unless this is just an error message it prob shouldn't be a string.
labelbox/schema/task.py
Outdated
response = requests.get(self.result) | ||
response.raise_for_status() | ||
data = response.json() | ||
return data['error'] |
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.
data.get('error')
https://labelbox.atlassian.net/browse/AL-2290