Add a from_blob_url method#7567
Conversation
|
Can one of the admins verify this patch? |
There was a problem hiding this comment.
I thought we were leaving the get_client behaviour unchanged?
There was a problem hiding this comment.
The behavior is unchanged, but we only accept strings now since the client init only accept strings.
There was a problem hiding this comment.
That's what I meant - I thought we planned to support properties as well as strings for these functions? And do the try/except name extraction here?
There was a problem hiding this comment.
sas_token appears to be discarded, so you can rename to _
There was a problem hiding this comment.
The snapshot value can't be an empty string, or false value, so in this case you can just make this: if snapshot:
There was a problem hiding this comment.
Do we want an equivalent def from_container_url?
Would probably make sense... though I don't know how common the container url scenario is.
There was a problem hiding this comment.
Another thing we should test is what kind of error you get, if any, if you supply the full blob URL to the constructor.
I believe the rest of the URL should be ignored in favour of the specified container/blob names
This reverts commit ad07f34c25f7662cbaed8b33ac05a1a6f6270dae.
94ad741 to
26c252f
Compare
lmazuel
left a comment
There was a problem hiding this comment.
Beware typing and docstring (sphinx) are not the same syntax
sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_service_client_async.py
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_service_client_async.py
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-blob/azure/storage/blob/aio/blob_service_client_async.py
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-blob/azure/storage/blob/aio/container_client_async.py
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py
Show resolved
Hide resolved
sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-blob/azure/storage/blob/blob_service_client.py
Outdated
Show resolved
Hide resolved
sdk/storage/azure-storage-blob/azure/storage/blob/container_client.py
Outdated
Show resolved
Hide resolved
lmazuel
left a comment
There was a problem hiding this comment.
Can't judge behavior, but no concern on doc or strcutrure
|
https://dev.azure.com/azure-sdk/public/_build/results?buildId=125260&view=results CI is green ...merging it |
* Update msrest and regenerate swagger. (#7308) * Update msrest and regenerate swagger. * override to get green CI. * Fix to have no content type when request body is empty (#7343) * Correct return types for list_secrets, _versions (#7268) * More useful exceptions for Key Vault errors (#7086) * Fix to have no content type when request body is empty * [Blob] Set tier and rehydrate (#7269) * [BlockBlob][Tier]Add BlobTier Support For CopyBlob/PutBlob/PutBlockList * [BlockBlob][Tier]Add Recordings for Standard BlobTier Support * [BlockBlob][Rehydrate]Enable Rehydrate Priority for Copy/SetTier * [BlockBlob][Rehydrate]Recordings for Rehydrate Priority for Copy/SetTier * [Blob] Echo client (#7350) * [EchoClientId]Verify Client Request ID in Response Same as in Request * [BlockBlob][Rehydrate]Fix Recordings * Refactor max_connections to max_concurrency (#7531) * Rename max_connections to max_concurrency * Other non breaking changes * comment changes * Use generated version as constant API version (#7547) * Re-recording from #7555 (#7585) * Storage batch API (#7387) * delete_blobs POC * Storage POC WIP * Storage POC async * Storage WIP * Storage clean-up * Storage options * Autorest remark * Use config option * SetBlobTier WIP * Working and tested delete_blobs + options * Set standard tier with tests * Adapt tests for playback mode * Move batch_send to common mixin * Python 2.7 compat * Fix snapshot bug * Re-record * Pass kwargs to batch * Clean x-ms-client-request-id from body if multipart response * remove duplicated comp=tier * Disable batch tests on Python 2.7 * pylint * Batch ChangeLog (#7593) * [Storage Blob] Regenerate Swagger (#7572) * Regenerate Swagger * small fix * adjusts literalincludes for msft docs (#7599) * Download sparse blob (#7555) * [PageBlob]Optimize Download Sparse File * Breaking Changes - Permission models (#7517) * Rename Permission related models to SasPermissions * Rewrite Permission Models * refactor tests * some tests * comment changes * remove length checks * QueuePermissions * File Permissions * blobs minor tweaks * minor fix * pylint fix * pylint * Fix batch docstrings (#7600) * Fix batch docstrings * pylint * [Rename]rename max_connections to max_concurrency (#7606) * small edits to lease client docs (#7550) * small edits to lease client docs * whitespace * Setup identity for unified pipelines. (#7578) * Setup keyvault for unified pipelines. (#7579) * Setup eventhubs for publishing via unified pipelines. (#7580) * Setup eventhubs for publishing via unified pipelines. * Fixed missing punctuation. * Setup cosmos for release via unified pipelines. (#7581) * bump CI * Manual network september (#7576) * generated files * adding 2019-07-01 * history and version * rerun tests * updated version * removed subscription id from tests * rerun tests again * replaced subscription id * [AutoPR] reservations/resource-manager (#7569) * [AutoPR reservations/resource-manager] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#7251) * Generated from f19a2e5b7f384018b74b21b7b8b8782d95b456f9 fixed x-ms-enum value * Generated from 2f56008117d578bec6cc8b8c832926f45a0fe52e fixed catalog definition * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * added version and history * [AutoPR] sql/resource-manager (#7535) * Generated from 9402dbf3fb3d5fffcb80f501b1fc857ff97ab723 (#7329) Fixing PR validation errors * regenerated * history and version * Setup app configuration with unified pipelines. (#7582) * [AutoPR] resources/resource-manager (#7549) * regenerated * updated history and version * updated date * Correct import_key parameter type (#7590) * add doc for tracing (#7616) * Add a from_blob_url method (#7567) * Add a from_blob_url method * Update tests * Recordings - common blob * Revert "Recordings - common blob" This reverts commit ad07f34c25f7662cbaed8b33ac05a1a6f6270dae. * comment changes * undo get_client changes * redo recordings * from_container_url * fix tests * tests fix for container url * pylint fix * Fix some docstring * docstrings * Doc imprvment for Storage (#7601) * Docstring improvement * File docstring * Queue docstrings * More doc fixes * More doc fixes * Revert "small edits to lease client docs (#7550)" (#7631) This reverts commit ed20b58. * kwarg-ify methods (#7611) * changeset1 * changeset-2 * changeset-3 * changeset-4 * minor fix * some final tweaks * pylint * minor fixes * max_concurrency * lease_id * pylint * fix * [Storage] Consolidate offset and range parameters (#7598) * Updated blob sync tests * Offset refactor APIS (#19) * rename to offset and length * fix * more changes * Updated blob sync tests * Temp block async tests * Fix upload page behaviour * Fix clear page behaviour * Update from_url offset behaviour * Update page ranges * Fix download blob behaviour * Some cleanup * Fixed page size * More test fixes * Some more fixes * Fixed page tests * Fixed encryption tests * Fix common test * append anf page blob async * some more test fixes * Fix live tests * more changes async * Fix sparse blob test * Last tests * update docstrings * pylint * Some Final tweaks (#7653) * Some final tweaks * comments * Fix live tests (#7665) * fix live tests * oops * few changes
* Update msrest and regenerate swagger. (Azure#7308) * Update msrest and regenerate swagger. * override to get green CI. * Fix to have no content type when request body is empty (Azure#7343) * Correct return types for list_secrets, _versions (Azure#7268) * More useful exceptions for Key Vault errors (Azure#7086) * Fix to have no content type when request body is empty * [Blob] Set tier and rehydrate (Azure#7269) * [BlockBlob][Tier]Add BlobTier Support For CopyBlob/PutBlob/PutBlockList * [BlockBlob][Tier]Add Recordings for Standard BlobTier Support * [BlockBlob][Rehydrate]Enable Rehydrate Priority for Copy/SetTier * [BlockBlob][Rehydrate]Recordings for Rehydrate Priority for Copy/SetTier * [Blob] Echo client (Azure#7350) * [EchoClientId]Verify Client Request ID in Response Same as in Request * [BlockBlob][Rehydrate]Fix Recordings * Refactor max_connections to max_concurrency (Azure#7531) * Rename max_connections to max_concurrency * Other non breaking changes * comment changes * Use generated version as constant API version (Azure#7547) * Re-recording from Azure#7555 (Azure#7585) * Storage batch API (Azure#7387) * delete_blobs POC * Storage POC WIP * Storage POC async * Storage WIP * Storage clean-up * Storage options * Autorest remark * Use config option * SetBlobTier WIP * Working and tested delete_blobs + options * Set standard tier with tests * Adapt tests for playback mode * Move batch_send to common mixin * Python 2.7 compat * Fix snapshot bug * Re-record * Pass kwargs to batch * Clean x-ms-client-request-id from body if multipart response * remove duplicated comp=tier * Disable batch tests on Python 2.7 * pylint * Batch ChangeLog (Azure#7593) * [Storage Blob] Regenerate Swagger (Azure#7572) * Regenerate Swagger * small fix * adjusts literalincludes for msft docs (Azure#7599) * Download sparse blob (Azure#7555) * [PageBlob]Optimize Download Sparse File * Breaking Changes - Permission models (Azure#7517) * Rename Permission related models to SasPermissions * Rewrite Permission Models * refactor tests * some tests * comment changes * remove length checks * QueuePermissions * File Permissions * blobs minor tweaks * minor fix * pylint fix * pylint * Fix batch docstrings (Azure#7600) * Fix batch docstrings * pylint * [Rename]rename max_connections to max_concurrency (Azure#7606) * small edits to lease client docs (Azure#7550) * small edits to lease client docs * whitespace * Setup identity for unified pipelines. (Azure#7578) * Setup keyvault for unified pipelines. (Azure#7579) * Setup eventhubs for publishing via unified pipelines. (Azure#7580) * Setup eventhubs for publishing via unified pipelines. * Fixed missing punctuation. * Setup cosmos for release via unified pipelines. (Azure#7581) * bump CI * Manual network september (Azure#7576) * generated files * adding 2019-07-01 * history and version * rerun tests * updated version * removed subscription id from tests * rerun tests again * replaced subscription id * [AutoPR] reservations/resource-manager (Azure#7569) * [AutoPR reservations/resource-manager] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (Azure#7251) * Generated from f19a2e5b7f384018b74b21b7b8b8782d95b456f9 fixed x-ms-enum value * Generated from 2f56008117d578bec6cc8b8c832926f45a0fe52e fixed catalog definition * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * added version and history * [AutoPR] sql/resource-manager (Azure#7535) * Generated from 9402dbf3fb3d5fffcb80f501b1fc857ff97ab723 (Azure#7329) Fixing PR validation errors * regenerated * history and version * Setup app configuration with unified pipelines. (Azure#7582) * [AutoPR] resources/resource-manager (Azure#7549) * regenerated * updated history and version * updated date * Correct import_key parameter type (Azure#7590) * add doc for tracing (Azure#7616) * Add a from_blob_url method (Azure#7567) * Add a from_blob_url method * Update tests * Recordings - common blob * Revert "Recordings - common blob" This reverts commit ad07f34c25f7662cbaed8b33ac05a1a6f6270dae. * comment changes * undo get_client changes * redo recordings * from_container_url * fix tests * tests fix for container url * pylint fix * Fix some docstring * docstrings * Doc imprvment for Storage (Azure#7601) * Docstring improvement * File docstring * Queue docstrings * More doc fixes * More doc fixes * Revert "small edits to lease client docs (Azure#7550)" (Azure#7631) This reverts commit ed20b58. * kwarg-ify methods (Azure#7611) * changeset1 * changeset-2 * changeset-3 * changeset-4 * minor fix * some final tweaks * pylint * minor fixes * max_concurrency * lease_id * pylint * fix * [Storage] Consolidate offset and range parameters (Azure#7598) * Updated blob sync tests * Offset refactor APIS (Azure#19) * rename to offset and length * fix * more changes * Updated blob sync tests * Temp block async tests * Fix upload page behaviour * Fix clear page behaviour * Update from_url offset behaviour * Update page ranges * Fix download blob behaviour * Some cleanup * Fixed page size * More test fixes * Some more fixes * Fixed page tests * Fixed encryption tests * Fix common test * append anf page blob async * some more test fixes * Fix live tests * more changes async * Fix sparse blob test * Last tests * update docstrings * pylint * Some Final tweaks (Azure#7653) * Some final tweaks * comments * Fix live tests (Azure#7665) * fix live tests * oops * few changes
* Update msrest and regenerate swagger. (#7308) * Update msrest and regenerate swagger. * override to get green CI. * Fix to have no content type when request body is empty (#7343) * Correct return types for list_secrets, _versions (#7268) * More useful exceptions for Key Vault errors (#7086) * Fix to have no content type when request body is empty * [Blob] Set tier and rehydrate (#7269) * [BlockBlob][Tier]Add BlobTier Support For CopyBlob/PutBlob/PutBlockList * [BlockBlob][Tier]Add Recordings for Standard BlobTier Support * [BlockBlob][Rehydrate]Enable Rehydrate Priority for Copy/SetTier * [BlockBlob][Rehydrate]Recordings for Rehydrate Priority for Copy/SetTier * [Blob] Echo client (#7350) * [EchoClientId]Verify Client Request ID in Response Same as in Request * [BlockBlob][Rehydrate]Fix Recordings * Refactor max_connections to max_concurrency (#7531) * Rename max_connections to max_concurrency * Other non breaking changes * comment changes * Use generated version as constant API version (#7547) * Re-recording from #7555 (#7585) * Storage batch API (#7387) * delete_blobs POC * Storage POC WIP * Storage POC async * Storage WIP * Storage clean-up * Storage options * Autorest remark * Use config option * SetBlobTier WIP * Working and tested delete_blobs + options * Set standard tier with tests * Adapt tests for playback mode * Move batch_send to common mixin * Python 2.7 compat * Fix snapshot bug * Re-record * Pass kwargs to batch * Clean x-ms-client-request-id from body if multipart response * remove duplicated comp=tier * Disable batch tests on Python 2.7 * pylint * Batch ChangeLog (#7593) * [Storage Blob] Regenerate Swagger (#7572) * Regenerate Swagger * small fix * adjusts literalincludes for msft docs (#7599) * Download sparse blob (#7555) * [PageBlob]Optimize Download Sparse File * Breaking Changes - Permission models (#7517) * Rename Permission related models to SasPermissions * Rewrite Permission Models * refactor tests * some tests * comment changes * remove length checks * QueuePermissions * File Permissions * blobs minor tweaks * minor fix * pylint fix * pylint * Fix batch docstrings (#7600) * Fix batch docstrings * pylint * [Rename]rename max_connections to max_concurrency (#7606) * small edits to lease client docs (#7550) * small edits to lease client docs * whitespace * Setup identity for unified pipelines. (#7578) * Setup keyvault for unified pipelines. (#7579) * Setup eventhubs for publishing via unified pipelines. (#7580) * Setup eventhubs for publishing via unified pipelines. * Fixed missing punctuation. * Setup cosmos for release via unified pipelines. (#7581) * bump CI * Manual network september (#7576) * generated files * adding 2019-07-01 * history and version * rerun tests * updated version * removed subscription id from tests * rerun tests again * replaced subscription id * [AutoPR] reservations/resource-manager (#7569) * [AutoPR reservations/resource-manager] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#7251) * Generated from f19a2e5b7f384018b74b21b7b8b8782d95b456f9 fixed x-ms-enum value * Generated from 2f56008117d578bec6cc8b8c832926f45a0fe52e fixed catalog definition * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * added version and history * [AutoPR] sql/resource-manager (#7535) * Generated from 9402dbf3fb3d5fffcb80f501b1fc857ff97ab723 (#7329) Fixing PR validation errors * regenerated * history and version * Setup app configuration with unified pipelines. (#7582) * [AutoPR] resources/resource-manager (#7549) * regenerated * updated history and version * updated date * Correct import_key parameter type (#7590) * add doc for tracing (#7616) * Add a from_blob_url method (#7567) * Add a from_blob_url method * Update tests * Recordings - common blob * Revert "Recordings - common blob" This reverts commit ad07f34c25f7662cbaed8b33ac05a1a6f6270dae. * comment changes * undo get_client changes * redo recordings * from_container_url * fix tests * tests fix for container url * pylint fix * Fix some docstring * docstrings * Doc imprvment for Storage (#7601) * Docstring improvement * File docstring * Queue docstrings * More doc fixes * More doc fixes * Revert "small edits to lease client docs (#7550)" (#7631) This reverts commit ed20b58. * kwarg-ify methods (#7611) * changeset1 * changeset-2 * changeset-3 * changeset-4 * minor fix * some final tweaks * pylint * minor fixes * max_concurrency * lease_id * pylint * fix * [Storage] Consolidate offset and range parameters (#7598) * Updated blob sync tests * Offset refactor APIS (#19) * rename to offset and length * fix * more changes * Updated blob sync tests * Temp block async tests * Fix upload page behaviour * Fix clear page behaviour * Update from_url offset behaviour * Update page ranges * Fix download blob behaviour * Some cleanup * Fixed page size * More test fixes * Some more fixes * Fixed page tests * Fixed encryption tests * Fix common test * append anf page blob async * some more test fixes * Fix live tests * more changes async * Fix sparse blob test * Last tests * update docstrings * pylint * Some Final tweaks (#7653) * Some final tweaks * comments * Fix live tests (#7665) * fix live tests * oops * few changes
BREAKING CHANGES
from_blob_urlmethod to instantiate blob_client using a blobURL__init__for BlobClient now accepts only anaccount_urlwith a container_name and blob_name.containerandblobparameters have been renamed tocontainer_nameandblob_nameacrossBlobClient,ContainerClientandBlobServiceClient. Also, only strings are accepted now and Properties model instance is not.Resolves #7511