@@ -114,7 +114,7 @@ async def _local_write_single(
114
114
@pathdispatch
115
115
async def write_stream (
116
116
path : Union [BasePath , BlobPath , str ],
117
- stream : BoostUnderlying [bytes ],
117
+ stream : BoostUnderlying [Union [ bytes , bytearray , memoryview ] ],
118
118
executor : BoostExecutor ,
119
119
overwrite : bool = False ,
120
120
) -> None :
@@ -133,7 +133,7 @@ async def write_stream(
133
133
@write_stream .register # type: ignore
134
134
async def _azure_write_stream (
135
135
path : AzurePath ,
136
- stream : BoostUnderlying [bytes ],
136
+ stream : BoostUnderlying [Union [ bytes , bytearray , memoryview ] ],
137
137
executor : BoostExecutor ,
138
138
overwrite : bool = False ,
139
139
) -> None :
@@ -147,7 +147,7 @@ async def _azure_write_stream(
147
147
md5 = hashlib .md5 ()
148
148
max_block_index = - 1
149
149
150
- async def upload_chunk (index_chunk : Tuple [int , bytes ]) -> None :
150
+ async def upload_chunk (index_chunk : Tuple [int , Union [ bytes , bytearray , memoryview ] ]) -> None :
151
151
block_index , chunk = index_chunk
152
152
# https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-list#remarks
153
153
assert block_index < AZURE_BLOCK_COUNT_LIMIT
@@ -172,7 +172,7 @@ async def upload_chunk(index_chunk: Tuple[int, bytes]) -> None:
172
172
@write_stream .register # type: ignore
173
173
async def _google_write_stream (
174
174
path : GooglePath ,
175
- stream : BoostUnderlying [bytes ],
175
+ stream : BoostUnderlying [Union [ bytes , bytearray , memoryview ] ],
176
176
executor : BoostExecutor ,
177
177
overwrite : bool = False ,
178
178
) -> None :
@@ -234,7 +234,7 @@ async def _google_write_stream(
234
234
@write_stream .register # type: ignore
235
235
async def _local_write_stream (
236
236
path : LocalPath ,
237
- stream : BoostUnderlying [bytes ],
237
+ stream : BoostUnderlying [Union [ bytes , bytearray , memoryview ] ],
238
238
executor : BoostExecutor ,
239
239
overwrite : bool = False ,
240
240
) -> None :
@@ -257,7 +257,7 @@ async def _local_write_stream(
257
257
@pathdispatch
258
258
async def write_stream_unordered (
259
259
path : Union [CloudPath , str ],
260
- stream : BoostUnderlying [Tuple [bytes , ByteRange ]],
260
+ stream : BoostUnderlying [Tuple [Union [ bytes , bytearray , memoryview ] , ByteRange ]],
261
261
executor : BoostExecutor ,
262
262
overwrite : bool = False ,
263
263
) -> None :
@@ -276,7 +276,7 @@ async def write_stream_unordered(
276
276
@write_stream_unordered .register # type: ignore
277
277
async def _azure_write_stream_unordered (
278
278
path : AzurePath ,
279
- stream : BoostUnderlying [Tuple [bytes , ByteRange ]],
279
+ stream : BoostUnderlying [Tuple [Union [ bytes , bytearray , memoryview ] , ByteRange ]],
280
280
executor : BoostExecutor ,
281
281
overwrite : bool = False ,
282
282
) -> None :
@@ -290,7 +290,9 @@ async def _azure_write_stream_unordered(
290
290
upload_id = get_upload_id ()
291
291
block_list = []
292
292
293
- async def upload_chunk (index_chunk_byte_range : Tuple [int , Tuple [bytes , ByteRange ]]) -> None :
293
+ async def upload_chunk (
294
+ index_chunk_byte_range : Tuple [int , Tuple [Union [bytes , bytearray , memoryview ], ByteRange ]]
295
+ ) -> None :
294
296
unordered_index , (chunk , byte_range ) = index_chunk_byte_range
295
297
# https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-list#remarks
296
298
assert unordered_index < AZURE_BLOCK_COUNT_LIMIT
0 commit comments