Azure-sdk-for-python: Update sphinx-docfx-yaml to properly generate intermediate yaml for keyword arguments

Created on 10 Dec 2019  路  16Comments  路  Source: Azure/azure-sdk-for-python

I've noticed that with the old azure-storage-blob (v1.5.0), when you upload a blob it doesn't care whether the blob exists already or not, it'll overwrite it, but with the new version, v12.1.0, when you go to upload a blob it will not overwrite an already existing blob. Not sure if this is a new feature or what, but it'd be nice to have it consistent with the old one. Or maybe even have a parameter to the upload blob method(s) to specify whether you should overwrite or not.

EngSys Service Attention Storage customer-reported feature-request

Most helpful comment

Hi @cccs-cat001 Thanks for reporting the issue. In version 12.0.0 and above, if you want upload to overwrite an existing blob, you will have to pass the overwrite key word only argument
Something like this:
blob.upload_blob(data, overwrite=True)

Note that the default value for overwrite is False.

All 16 comments

@cccs-cat001 thanks for the feedback! I am looping in someone from our team to take a look at this //cc: @mayurid @rakshith91

Hi @cccs-cat001 Thanks for reporting the issue. In version 12.0.0 and above, if you want upload to overwrite an existing blob, you will have to pass the overwrite key word only argument
Something like this:
blob.upload_blob(data, overwrite=True)

Note that the default value for overwrite is False.

Perfect that works! Can that be added to the documentation? Nowhere does it mention that you need to specify that.

@cccs-cat001
That's a good catch. We'll definitely update it. Meanwhile, i'd encourage using this documentation for now till we fix the issues with the other one. Closing this issue for now, but feel free to reopen/ create another issue if you have more concerns..thank you so much for bringing this to our notice :)

Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.

@rakshith91 I just ran into this issue. Any ETA on when the documentation will be updated? It's been 3 months already.

also does this apply to the aio client? I've tried the overwrite=True kwarg and it's still failing with

azure.storage.blob._generated.models._models_py3.StorageErrorException: This request is not authorized to perform blob overwrites.

(edit: using aio BlobServiceClient/BlobClient with block storage type on version 12.1.0)

I've been looking through the code and from what I can tell, overwrite=True only changes what exception gets thrown

I also ran into this issue, the documentation should be updated for this.

How can i specify overwrite = true and headers at the same time?

I also just hit this issue. Still nothing in the docs! :-) (8 months)

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Removing @xiafu-msft , adding myself. Status: opened a PR and am pushing a resolution through the docs pipeline.

Hi @howardjones

Please refer to this doc for now, https://azuresdkdocs.blob.core.windows.net/$web/python/azure-storage-blob/12.3.2/azure.storage.blob.html#azure.storage.blob.BlobClient.upload_blob it should have keyword arguments listed. Sorry about the inconvenience.

Added EngSys label and updated title for better tracking of this issue.

This issue was erroneously closed. Issue meant to be closed when this PR merges.

Fixed. keyword params render

Apologies to everyone for the wait.

I've filed another follow-up item for updating the parameter labeling.

Was this page helpful?
0 / 5 - 0 ratings