Skip to content
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

fix azure container name and blob name in download_from_azure #733

Merged
merged 3 commits into from
Aug 2, 2024
Merged
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
Next Next commit
fix azure container name and blob name in download_from_azure
  • Loading branch information
Ubuntu authored and Ubuntu committed Jul 23, 2024
commit 3e799146f1f163a2fde52fb61a0786c28f8c7a02
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
Loading