-
Notifications
You must be signed in to change notification settings - Fork 3k
Upload async file data #28307
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
Comments
Thank you for your feedback. This has been routed to the support team for assistance. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage. Issue DetailsIs your feature request related to a problem? Please describe. async with aiofiles.open(file=path, mode="rb") as data:
await blob_client.upload_blob(data, metadata=tags, overwrite=True) This doens't work, the data is supposed to be bytes. Describe the solution you'd like Describe alternatives you've considered async with aiofiles.open(file=path, mode="rb") as data:
dt = await data.read()
await blob_client.upload_blob(dt, metadata=tags, overwrite=True) As long as my files don't get too large, this will work Additional context
|
@jalauzon-msft @vincenttran-msft Could you please look into this once you get a chance ? Thanks in advance. |
Hi @aersam Adrian, thanks for reaching out. Could you please share which version of the Blob SDK you are using? We recently released support for streams with an async from azure.storage.blob.aio import BlobClient |
Hi there I am using the aio variants. who does not ? :) pyright already complains when doing so: async with aiofiles.open(file=fake_path or data.path, mode="rb") as fdata:
await blob_client.upload_blob(fdata, metadata=data.tags, overwrite=True) the error at runtime:
|
it's a bit strange: I looked at your helper code and it basically does a check with I could fix it, see my PR |
Hi @aersam Adrian, thanks for the PR! Strange that If they approve, there are one or two other places we'd need to apply this change at the same time that I may ask you to do or just submit a PR myself if I have the time. |
Hi again @aersam Adrian, I discussed with the team, and we think your change looks good and should help to increase our compatibility with different stream types. There were a few more places we needed to make this change in addition to your PR, so I went ahead and created #28472 instead of making you track them down. I will close #28410 in favor of this one. |
Is your feature request related to a problem? Please describe.
Hi there! I'm trying to upload a block blob using an async source:
This doens't work, the data is supposed to be bytes.
Describe the solution you'd like
I'd like to be able to use an async stream as source for the async Blob Client
Describe alternatives you've considered
My current workaround is to load the whole file into RAM:
As long as my files don't get too large, this will work
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: