Skip to content

Conversation

@TumanyanV
Copy link
Contributor

No description provided.

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'):
Copy link
Contributor

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

Choose a reason for hiding this comment

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

Suggested change
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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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')
Copy link
Contributor

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",
Copy link
Contributor

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'
Copy link
Contributor

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(
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 add "raise_for_status=True" to not handle each request

@VaghinakDev VaghinakDev changed the base branch from friday to 1278_serializers_fix September 6, 2022 14:54
@VaghinakDev VaghinakDev merged commit 3b8d306 into 1278_serializers_fix Sep 6, 2022
@VaghinakDev VaghinakDev deleted the 1297_download_large_files branch September 9, 2022 11:37
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.

4 participants