Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions firecrest/v2/_async/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ async def upload_file_to_stage(self):
"transferDirectives", {}
).get("parts_upload_urls")

if urls is None:
urls = self._transfer_info.get(
"transferDirectives", {}
).get("partsUploadUrls")

if urls is None:
raise MultipartUploadException(
self._transfer_info,
Expand Down Expand Up @@ -178,6 +183,11 @@ async def _upload_part(self, url, index):
"transferDirectives", {}
).get("max_part_size")

if chunk_size is None:
chunk_size = self._transfer_info.get(
"transferDirectives", {}
).get("maxPartSize")

if chunk_size is None:
raise MultipartUploadException(
self._transfer_info,
Expand Down Expand Up @@ -241,6 +251,11 @@ async def _complete_upload(self, checksum):
"transferDirectives", {}
).get("complete_upload_url")

if url is None:
url = self._transfer_info.get(
"transferDirectives", {}
).get("completeUploadUrl")

if url is None:
raise MultipartUploadException(
self._transfer_info,
Expand Down Expand Up @@ -309,6 +324,11 @@ async def download_file_from_stage(self, file_path=None):
"transferDirectives", {}
).get("download_url")

if download_url is None:
download_url = self._transfer_info.get(
"transferDirectives", {}
).get("downloadUrl")

if download_url is None:
raise MultipartUploadException(
self._transfer_info,
Expand Down Expand Up @@ -1550,9 +1570,14 @@ async def upload(
local_file=local_file,
)

actual_transfer_method = transfer_info.get(
"transferDirectives", {}
).get("transfer_method", "s3")
trans_dir = transfer_info.get("transferDirectives", {})
if trans_dir:
actual_transfer_method = trans_dir.get(
"transferMethod",
trans_dir.get("transfer_method", "s3")
)
else:
actual_transfer_method = "s3"

if blocking:
self.log(
Expand Down
31 changes: 28 additions & 3 deletions firecrest/v2/_sync/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ def upload_file_to_stage(self):
"transferDirectives", {}
).get("parts_upload_urls")

if urls is None:
urls = self._transfer_info.get(
"transferDirectives", {}
).get("partsUploadUrls")

if urls is None:
raise MultipartUploadException(
self._transfer_info,
Expand Down Expand Up @@ -177,6 +182,11 @@ def _upload_part(self, url, index):
"transferDirectives", {}
).get("max_part_size")

if chunk_size is None:
chunk_size = self._transfer_info.get(
"transferDirectives", {}
).get("maxPartSize")

if chunk_size is None:
raise MultipartUploadException(
self._transfer_info,
Expand Down Expand Up @@ -250,6 +260,11 @@ def _complete_upload(self, checksum):
"transferDirectives", {}
).get("complete_upload_url")

if url is None:
url = self._transfer_info.get(
"transferDirectives", {}
).get("completeUploadUrl")

if url is None:
raise MultipartUploadException(
self._transfer_info,
Expand Down Expand Up @@ -318,6 +333,11 @@ def download_file_from_stage(self, file_path=None):
"transferDirectives", {}
).get("download_url")

if download_url is None:
download_url = self._transfer_info.get(
"transferDirectives", {}
).get("downloadUrl")

if download_url is None:
raise MultipartUploadException(
self._transfer_info,
Expand Down Expand Up @@ -1690,9 +1710,14 @@ def download(
file_path=target_path
)

actual_transfer_method = transfer_info.get(
"transferDirectives", {}
).get("transfer_method", "s3")
trans_dir = transfer_info.get("transferDirectives", {})
if trans_dir:
actual_transfer_method = trans_dir.get(
"transferMethod",
trans_dir.get("transfer_method", "s3")
)
else:
actual_transfer_method = "s3"

if blocking:
self.log(
Expand Down