You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""A version indicator for the newly created object."""
20
+
21
+
defput(
7
22
store: ObjectStore,
8
23
location: str,
9
24
file: IO[bytes] |Path|bytes,
10
25
*,
11
-
chunk_size: int=5*1024,
26
+
use_multipart: bool|None=None,
27
+
chunk_size: int=5*1024*1024,
12
28
max_concurrency: int=12,
13
-
) ->None:
29
+
) ->PutResult:
14
30
"""Save the provided bytes to the specified location
15
31
16
32
The operation is guaranteed to be atomic, it will either successfully write the
17
33
entirety of `file` to `location`, or fail. No clients should be able to observe a
18
34
partially written object.
19
35
20
-
This will use a multipart upload under the hood.
21
-
22
36
Args:
23
37
store: The ObjectStore instance to use.
24
38
location: The path within ObjectStore for where to save the file.
25
39
file: The object to upload. Can either be file-like, a `Path` to a local file,
26
40
or a `bytes` object.
41
+
42
+
Keyword args:
43
+
use_multipart: Whether to use a multipart upload under the hood. Defaults using a multipart upload if the length of the file is greater than `chunk_size`.
27
44
chunk_size: The size of chunks to use within each part of the multipart upload. Defaults to 5 MB.
28
45
max_concurrency: The maximum number of chunks to upload concurrently. Defaults to 12.
29
46
"""
30
47
31
-
asyncdefput_file_async(
48
+
asyncdefput_async(
32
49
store: ObjectStore,
33
50
location: str,
34
51
file: IO[bytes] |Path|bytes,
35
52
*,
36
-
chunk_size: int=5*1024,
53
+
use_multipart: bool|None=None,
54
+
chunk_size: int=5*1024*1024,
37
55
max_concurrency: int=12,
38
-
) ->None:
39
-
"""Call `put_file` asynchronously.
56
+
) ->PutResult:
57
+
"""Call `put` asynchronously.
40
58
41
-
Refer to the documentation for [put_file][object_store_rs.put_file].
59
+
Refer to the documentation for [put][object_store_rs.put].
0 commit comments