Skip to content

Commit

Permalink
fix azure container name and blob name in download_from_azure (#733)
Browse files Browse the repository at this point in the history
Co-authored-by: Ubuntu <azureuser@CPU.mfv5qmmvdxdepnhdplkezcwz3g.bx.internal.cloudapp.net>
Co-authored-by: Saaketh Narayan <[email protected]>
  • Loading branch information
3 people authored Aug 2, 2024
1 parent 54b6801 commit 3a6a549
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion streaming/base/storage/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,10 @@ def download_from_azure(remote: str, local: str) -> None:
account_url=f"https://{os.environ['AZURE_ACCOUNT_NAME']}.blob.core.windows.net",
credential=os.environ['AZURE_ACCOUNT_ACCESS_KEY'])
try:
blob_client = service.get_blob_client(container=obj.netloc, blob=obj.path.lstrip('/'))
file_path = obj.path.lstrip('/').split('/')
container_name = file_path[0]
blob_name = os.path.join(*file_path[1:])
blob_client = service.get_blob_client(container=container_name, blob=blob_name)
local_tmp = local + '.tmp'
with open(local_tmp, 'wb') as my_blob:
blob_data = blob_client.download_blob()
Expand Down

0 comments on commit 3a6a549

Please sign in to comment.