-
Notifications
You must be signed in to change notification settings - Fork 14
1297 download large files #491
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
| if self.api_url != constance.BACKEND_URL: | ||
| return "https://assets-provider.devsuperannotate.com/api/v1.01/" | ||
| return "https://assets-provider.superannotate.com/api/v1.01/" | ||
| def get_assets_provider_url(self, version = 'v2'): |
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.
We always should use one version of the assets provider in this case V2
| URL_START_FILE_SYNC = "items/{item_id}/annotations/sync" | ||
| URL_START_FILE_SYNC_STATUS = "items/{item_id}/annotations/sync/status" | ||
| URL_CLASSIFY_ITEM_SIZE = "items/annotations/download/method" | ||
| URL_SYNC_LARGE_ANNOTATION = "items/{}/annotations/sync" |
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.
| URL_SYNC_LARGE_ANNOTATION = "items/{}/annotations/sync" | |
| URL_SYNC_LARGE_ANNOTATION = "items/{item_id}/annotations/sync" |
to avoid mistakes and suggest input
| URL_START_FILE_SYNC = "items/{item_id}/annotations/sync" | ||
| URL_START_FILE_SYNC_STATUS = "items/{item_id}/annotations/sync/status" | ||
| URL_CLASSIFY_ITEM_SIZE = "items/annotations/download/method" | ||
| URL_SYNC_LARGE_ANNOTATION = "items/{}/annotations/sync" |
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.
| URL_SYNC_LARGE_ANNOTATION = "items/{}/annotations/sync" | |
| URL_SYNC_LARGE_ANNOTATION = "items/{item_id}/annotations/sync" |
| "version":"V1.00" | ||
| } | ||
|
|
||
| url = urljoin(self.get_assets_provider_url('v1.01'), f'items/{item_id}/annotations/download') |
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.
To keep consistency let's use class variables for URLs
| "project_id": project_id, | ||
| "desired_transform_version": "export", | ||
| "desired_version":"V1.00", | ||
| "current_transform_version": "V1.00", |
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.
desired_version and current_transform_version should not be hard coded(lats hard coded as class variable) )
| } | ||
|
|
||
| url = urljoin( | ||
| self.get_assets_provider_url('v2'), 'items/annotations/download/method' |
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.
We already have a class variable for this URL
| await asyncio.sleep(1) | ||
|
|
||
|
|
||
| async with aiohttp.ClientSession( |
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 add "raise_for_status=True" to not handle each request
No description provided.