Skip to content

Commit 9f7a15d

Browse files
[Storage] Fix documentation for start_copy_from_url (Azure#24034)
1 parent 4cfe46e commit 9f7a15d

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,11 +1946,14 @@ def _start_copy_from_url_options(self, source_url, metadata=None, incremental_co
19461946
@distributed_trace
19471947
def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, **kwargs):
19481948
# type: (str, Optional[Dict[str, str]], bool, **Any) -> Dict[str, Union[str, datetime]]
1949-
"""Copies a blob asynchronously.
1950-
1951-
This operation returns a copy operation
1952-
object that can be used to wait on the completion of the operation,
1953-
as well as check status or abort the copy operation.
1949+
"""Copies a blob from the given URL.
1950+
1951+
This operation returns a dictionary containing `copy_status` and `copy_id`,
1952+
which can be used to check the status of or abort the copy operation.
1953+
`copy_status` will be 'success' if the copy completed synchronously or
1954+
'pending' if the copy has been started asynchronously. For asynchronous copies,
1955+
the status can be checked by polling the :func:`get_blob_properties` method and
1956+
checking the copy status. Set `requires_sync` to True to force the copy to be synchronous.
19541957
The Blob service copies blobs on a best-effort basis.
19551958
19561959
The source blob for a copy operation may be a block blob, an append blob,
@@ -1973,10 +1976,6 @@ def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False,
19731976
end of the copy operation, the destination blob will have the same committed
19741977
block count as the source.
19751978
1976-
For all blob types, you can call status() on the returned polling object
1977-
to check the status of the copy operation, or wait() to block until the
1978-
operation is complete. The final blob will be committed when the copy completes.
1979-
19801979
:param str source_url:
19811980
A URL of up to 2 KB in length that specifies a file or blob.
19821981
The value should be URL-encoded as it would appear in a request URI.

sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,12 +1126,15 @@ async def create_snapshot(self, metadata=None, **kwargs):
11261126

11271127
@distributed_trace_async
11281128
async def start_copy_from_url(self, source_url, metadata=None, incremental_copy=False, **kwargs):
1129-
# type: (str, Optional[Dict[str, str]], bool, Any) -> Any
1130-
"""Copies a blob asynchronously.
1131-
1132-
This operation returns a copy operation
1133-
object that can be used to wait on the completion of the operation,
1134-
as well as check status or abort the copy operation.
1129+
# type: (str, Optional[Dict[str, str]], bool, Any) -> Dict[str, Union[str, datetime]]
1130+
"""Copies a blob from the given URL.
1131+
1132+
This operation returns a dictionary containing `copy_status` and `copy_id`,
1133+
which can be used to check the status of or abort the copy operation.
1134+
`copy_status` will be 'success' if the copy completed synchronously or
1135+
'pending' if the copy has been started asynchronously. For asynchronous copies,
1136+
the status can be checked by polling the :func:`get_blob_properties` method and
1137+
checking the copy status. Set `requires_sync` to True to force the copy to be synchronous.
11351138
The Blob service copies blobs on a best-effort basis.
11361139
11371140
The source blob for a copy operation may be a block blob, an append blob,
@@ -1154,10 +1157,6 @@ async def start_copy_from_url(self, source_url, metadata=None, incremental_copy=
11541157
end of the copy operation, the destination blob will have the same committed
11551158
block count as the source.
11561159
1157-
For all blob types, you can call status() on the returned polling object
1158-
to check the status of the copy operation, or wait() to block until the
1159-
operation is complete. The final blob will be committed when the copy completes.
1160-
11611160
:param str source_url:
11621161
A URL of up to 2 KB in length that specifies a file or blob.
11631162
The value should be URL-encoded as it would appear in a request URI.

0 commit comments

Comments
 (0)