Skip to content

Conversation

msokoloff1
Copy link
Contributor

  • Fetch the result file for the user
  • Try to match AnnotationImport.statuses and .errors as close as possible.

@msokoloff1 msokoloff1 force-pushed the ms/fetch-result branch 2 times, most recently from fab754d to a645024 Compare June 3, 2022 21:41
return data.get('error')
if self.status == "FAILED":
result = self._fetch_remote_json()
return result['error']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result.get('error')?

Copy link
Contributor Author

@msokoloff1 msokoloff1 Jun 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that this should never be None since we are specifically checking that the action is a Json import.

@msokoloff1 msokoloff1 requested a review from kkim-labelbox June 5, 2022 19:53
self.wait_till_done(timeout_seconds=600)
if self.status == "IN_PROGRESS":
raise ValueError(
"Job status still in `IN_PROGRESS`. The result is not available. Increase timeout or contact support."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increase timeout or contact support. since this method is being called from errors and result but those don't accept a timeout param, increasing the timeout would be harder for a user. Should we include a timeout param in the other methods, or just ask them to contact support?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also since this is lru_cache, does that mean that this will cache the first result, and always return the same result for any subsequent calls while a script runs? Would it make more sense since we don't need to evict any items from the cache, to just use @cache instead?

https://docs.python.org/3/library/functools.html#functools.cache

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They can wait_till_done before calling this with a larger timeout. I'll update the message to make this clear. Also the cache does not save the result if an error is thrown.

@msokoloff1 msokoloff1 requested a review from jtsodapop June 6, 2022 17:21
@msokoloff1 msokoloff1 merged commit 6b147ff into develop Jun 6, 2022
@jtsodapop jtsodapop deleted the ms/fetch-result branch September 14, 2022 15:52
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