metaflow-stubs 2.12.28__py2.py3-none-any.whl → 2.12.29__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. metaflow-stubs/__init__.pyi +297 -3001
  2. metaflow-stubs/cards.pyi +19 -473
  3. metaflow-stubs/cli.pyi +17 -81
  4. metaflow-stubs/client/__init__.pyi +19 -1113
  5. metaflow-stubs/client/core.pyi +18 -158
  6. metaflow-stubs/client/filecache.pyi +8 -12
  7. metaflow-stubs/clone_util.pyi +6 -26
  8. metaflow-stubs/events.pyi +6 -5
  9. metaflow-stubs/exception.pyi +8 -6
  10. metaflow-stubs/flowspec.pyi +22 -106
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +16 -564
  13. metaflow-stubs/info_file.pyi +6 -5
  14. metaflow-stubs/metadata_provider/__init__.pyi +16 -0
  15. metaflow-stubs/metadata_provider/heartbeat.pyi +34 -0
  16. metaflow-stubs/{metadata → metadata_provider}/metadata.pyi +10 -22
  17. metaflow-stubs/metadata_provider/util.pyi +19 -0
  18. metaflow-stubs/metaflow_config.pyi +8 -11
  19. metaflow-stubs/metaflow_current.pyi +10 -9
  20. metaflow-stubs/mflog/__init__.pyi +6 -0
  21. metaflow-stubs/mflog/mflog.pyi +52 -5
  22. metaflow-stubs/multicore_utils.pyi +6 -5
  23. metaflow-stubs/parameters.pyi +13 -23
  24. metaflow-stubs/plugins/__init__.pyi +51 -163
  25. metaflow-stubs/plugins/airflow/__init__.pyi +12 -5
  26. metaflow-stubs/plugins/airflow/airflow.pyi +19 -130
  27. metaflow-stubs/plugins/airflow/airflow_cli.pyi +17 -136
  28. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +7 -26
  29. metaflow-stubs/plugins/airflow/airflow_utils.pyi +7 -6
  30. metaflow-stubs/plugins/airflow/exception.pyi +7 -11
  31. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +10 -97
  32. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +9 -30
  33. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +9 -40
  34. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +9 -40
  35. metaflow-stubs/plugins/argo/__init__.pyi +12 -5
  36. metaflow-stubs/plugins/argo/argo_client.pyi +8 -26
  37. metaflow-stubs/plugins/argo/argo_events.pyi +7 -11
  38. metaflow-stubs/plugins/argo/argo_workflows.pyi +16 -120
  39. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +22 -460
  40. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +12 -404
  41. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +65 -322
  42. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +165 -0
  43. metaflow-stubs/plugins/aws/__init__.pyi +11 -5
  44. metaflow-stubs/plugins/aws/aws_client.pyi +6 -5
  45. metaflow-stubs/plugins/aws/aws_utils.pyi +6 -11
  46. metaflow-stubs/plugins/aws/batch/__init__.pyi +10 -5
  47. metaflow-stubs/plugins/aws/batch/batch.pyi +10 -55
  48. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +10 -31
  49. metaflow-stubs/plugins/aws/batch/batch_client.pyi +7 -11
  50. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +15 -140
  51. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +7 -5
  52. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +10 -21
  53. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +15 -5
  54. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +6 -5
  55. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +6 -5
  56. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +6 -5
  57. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +7 -5
  58. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +11 -65
  59. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +19 -175
  60. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +6 -5
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +8 -37
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +53 -290
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +127 -0
  64. metaflow-stubs/plugins/azure/__init__.pyi +12 -7
  65. metaflow-stubs/plugins/azure/azure_credential.pyi +6 -5
  66. metaflow-stubs/plugins/azure/azure_exceptions.pyi +7 -11
  67. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +11 -24
  68. metaflow-stubs/plugins/azure/azure_utils.pyi +11 -29
  69. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +8 -23
  70. metaflow-stubs/plugins/azure/includefile_support.pyi +7 -17
  71. metaflow-stubs/plugins/cards/__init__.pyi +15 -5
  72. metaflow-stubs/plugins/cards/card_cli.pyi +22 -491
  73. metaflow-stubs/plugins/cards/card_client.pyi +13 -75
  74. metaflow-stubs/plugins/cards/card_creator.pyi +7 -10
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +10 -18
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +10 -126
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +14 -81
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +14 -97
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +6 -5
  80. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +12 -73
  81. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +6 -61
  82. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +6 -5
  83. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +8 -45
  84. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +7 -6
  85. metaflow-stubs/plugins/cards/card_modules/components.pyi +25 -108
  86. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +6 -5
  87. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +6 -12
  88. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +11 -88
  89. metaflow-stubs/plugins/cards/card_resolver.pyi +6 -49
  90. metaflow-stubs/plugins/cards/component_serializer.pyi +13 -63
  91. metaflow-stubs/plugins/cards/exception.pyi +7 -11
  92. metaflow-stubs/plugins/catch_decorator.pyi +10 -30
  93. metaflow-stubs/plugins/datatools/__init__.pyi +13 -392
  94. metaflow-stubs/plugins/datatools/local.pyi +7 -11
  95. metaflow-stubs/plugins/datatools/s3/__init__.pyi +19 -653
  96. metaflow-stubs/plugins/datatools/s3/s3.pyi +16 -264
  97. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +7 -10
  98. metaflow-stubs/plugins/datatools/s3/s3util.pyi +6 -11
  99. metaflow-stubs/plugins/debug_logger.pyi +7 -5
  100. metaflow-stubs/plugins/debug_monitor.pyi +7 -5
  101. metaflow-stubs/plugins/environment_decorator.pyi +7 -5
  102. metaflow-stubs/plugins/events_decorator.pyi +8 -14
  103. metaflow-stubs/plugins/frameworks/__init__.pyi +7 -5
  104. metaflow-stubs/plugins/frameworks/pytorch.pyi +8 -45
  105. metaflow-stubs/plugins/gcp/__init__.pyi +11 -7
  106. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +11 -24
  107. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +7 -11
  108. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +6 -5
  109. metaflow-stubs/plugins/gcp/gs_utils.pyi +8 -20
  110. metaflow-stubs/plugins/gcp/includefile_support.pyi +7 -17
  111. metaflow-stubs/plugins/kubernetes/__init__.pyi +13 -5
  112. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +6 -10
  113. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +9 -29
  114. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +16 -155
  115. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +9 -72
  116. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +19 -142
  117. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +8 -41
  118. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +7 -11
  119. metaflow-stubs/plugins/logs_cli.pyi +11 -10
  120. metaflow-stubs/plugins/package_cli.pyi +7 -5
  121. metaflow-stubs/plugins/parallel_decorator.pyi +11 -59
  122. metaflow-stubs/plugins/project_decorator.pyi +8 -14
  123. metaflow-stubs/plugins/pypi/__init__.pyi +12 -11
  124. metaflow-stubs/plugins/pypi/conda_decorator.pyi +8 -27
  125. metaflow-stubs/plugins/pypi/conda_environment.pyi +14 -20
  126. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +7 -5
  127. metaflow-stubs/plugins/pypi/pypi_environment.pyi +7 -39
  128. metaflow-stubs/plugins/pypi/utils.pyi +7 -11
  129. metaflow-stubs/plugins/resources_decorator.pyi +7 -5
  130. metaflow-stubs/plugins/retry_decorator.pyi +7 -11
  131. metaflow-stubs/plugins/secrets/__init__.pyi +9 -5
  132. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +9 -14
  133. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +7 -11
  134. metaflow-stubs/plugins/storage_executor.pyi +6 -11
  135. metaflow-stubs/plugins/tag_cli.pyi +14 -396
  136. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +9 -34
  137. metaflow-stubs/plugins/timeout_decorator.pyi +8 -12
  138. metaflow-stubs/procpoll.pyi +7 -5
  139. metaflow-stubs/pylint_wrapper.pyi +7 -11
  140. metaflow-stubs/runner/__init__.pyi +13 -5
  141. metaflow-stubs/runner/deployer.pyi +102 -210
  142. metaflow-stubs/runner/deployer_impl.pyi +87 -0
  143. metaflow-stubs/runner/metaflow_runner.pyi +24 -508
  144. metaflow-stubs/runner/nbdeploy.pyi +16 -60
  145. metaflow-stubs/runner/nbrun.pyi +11 -148
  146. metaflow-stubs/runner/subprocess_manager.pyi +9 -10
  147. metaflow-stubs/runner/utils.pyi +44 -9
  148. metaflow-stubs/system/__init__.pyi +9 -87
  149. metaflow-stubs/system/system_logger.pyi +7 -6
  150. metaflow-stubs/system/system_monitor.pyi +6 -5
  151. metaflow-stubs/tagging_util.pyi +6 -10
  152. metaflow-stubs/tuple_util.pyi +6 -5
  153. metaflow-stubs/version.pyi +6 -5
  154. {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.29.dist-info}/METADATA +2 -2
  155. metaflow_stubs-2.12.29.dist-info/RECORD +158 -0
  156. metaflow-stubs/metadata/util.pyi +0 -18
  157. metaflow_stubs-2.12.28.dist-info/RECORD +0 -152
  158. {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.29.dist-info}/WHEEL +0 -0
  159. {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.29.dist-info}/top_level.txt +0 -0
@@ -1,399 +1,20 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.481564 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.586398 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- import typing
10
- if typing.TYPE_CHECKING:
11
- import io
12
- import metaflow.plugins.datatools.s3.s3
13
- import metaflow.exception
14
9
 
15
- def read_in_chunks(dst, src, src_sz, max_chunk_size):
16
- ...
17
-
18
- class MetaflowLocalNotFound(metaflow.exception.MetaflowException, metaclass=type):
19
- ...
20
-
21
- class MetaflowLocalURLException(metaflow.exception.MetaflowException, metaclass=type):
22
- ...
10
+ from . import local as local
11
+ from .local import MetaflowLocalNotFound as MetaflowLocalNotFound
12
+ from .local import MetaflowLocalURLException as MetaflowLocalURLException
13
+ from .local import Local as Local
14
+ from . import s3 as s3
15
+ from .s3.s3 import MetaflowS3Exception as MetaflowS3Exception
16
+ from .s3.s3 import S3 as S3
23
17
 
24
- class Local(object, metaclass=type):
25
- """
26
- This class allows you to access the local filesystem in a way similar to the S3 datatools
27
- client. It is a stripped down version for now and only implements the functionality needed
28
- for this use case.
29
-
30
- In the future, we may want to allow it to be used in a way similar to the S3() client.
31
- """
32
- @classmethod
33
- def get_root_from_config(cls, echo, create_on_absent = True):
34
- ...
35
- def __init__(self):
36
- """
37
- Initialize a new context for Local file operations. This object is based used as
38
- a context manager for a with statement.
39
- """
40
- ...
41
- def __enter__(self):
42
- ...
43
- def __exit__(self, *args):
44
- ...
45
- def get(self, key = None, return_missing = False):
46
- ...
47
- def put(self, key, obj, overwrite = True):
48
- ...
49
- def info(self, key = None, return_missing = False):
50
- ...
51
- ...
52
-
53
- class MetaflowS3Exception(metaflow.exception.MetaflowException, metaclass=type):
54
- ...
55
-
56
- class S3(object, metaclass=type):
57
- """
58
- The Metaflow S3 client.
59
-
60
- This object manages the connection to S3 and a temporary diretory that is used
61
- to download objects. Note that in most cases when the data fits in memory, no local
62
- disk IO is needed as operations are cached by the operating system, which makes
63
- operations fast as long as there is enough memory available.
64
-
65
- The easiest way is to use this object as a context manager:
66
- ```
67
- with S3() as s3:
68
- data = [obj.blob for obj in s3.get_many(urls)]
69
- print(data)
70
- ```
71
- The context manager takes care of creating and deleting a temporary directory
72
- automatically. Without a context manager, you must call `.close()` to delete
73
- the directory explicitly:
74
- ```
75
- s3 = S3()
76
- data = [obj.blob for obj in s3.get_many(urls)]
77
- s3.close()
78
- ```
79
- You can customize the location of the temporary directory with `tmproot`. It
80
- defaults to the current working directory.
81
-
82
- To make it easier to deal with object locations, the client can be initialized
83
- with an S3 path prefix. There are three ways to handle locations:
84
-
85
- 1. Use a `metaflow.Run` object or `self`, e.g. `S3(run=self)` which
86
- initializes the prefix with the global `DATATOOLS_S3ROOT` path, combined
87
- with the current run ID. This mode makes it easy to version data based
88
- on the run ID consistently. You can use the `bucket` and `prefix` to
89
- override parts of `DATATOOLS_S3ROOT`.
90
-
91
- 2. Specify an S3 prefix explicitly with `s3root`,
92
- e.g. `S3(s3root='s3://mybucket/some/path')`.
93
-
94
- 3. Specify nothing, i.e. `S3()`, in which case all operations require
95
- a full S3 url prefixed with `s3://`.
96
-
97
- Parameters
98
- ----------
99
- tmproot : str, default: '.'
100
- Where to store the temporary directory.
101
- bucket : str, optional
102
- Override the bucket from `DATATOOLS_S3ROOT` when `run` is specified.
103
- prefix : str, optional
104
- Override the path from `DATATOOLS_S3ROOT` when `run` is specified.
105
- run : FlowSpec or Run, optional
106
- Derive path prefix from the current or a past run ID, e.g. S3(run=self).
107
- s3root : str, optional
108
- If `run` is not specified, use this as the S3 prefix.
109
- """
110
- @classmethod
111
- def get_root_from_config(cls, echo, create_on_absent = True):
112
- ...
113
- def __enter__(self) -> metaflow.plugins.datatools.s3.s3.S3:
114
- ...
115
- def __exit__(self, *args):
116
- ...
117
- def close(self):
118
- """
119
- Delete all temporary files downloaded in this context.
120
- """
121
- ...
122
- def list_paths(self, keys: typing.Optional[typing.Iterable[str]] = None) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
123
- """
124
- List the next level of paths in S3.
125
-
126
- If multiple keys are specified, listings are done in parallel. The returned
127
- S3Objects have `.exists == False` if the path refers to a prefix, not an
128
- existing S3 object.
129
-
130
- For instance, if the directory hierarchy is
131
- ```
132
- a/0.txt
133
- a/b/1.txt
134
- a/c/2.txt
135
- a/d/e/3.txt
136
- f/4.txt
137
- ```
138
- The `list_paths(['a', 'f'])` call returns
139
- ```
140
- a/0.txt (exists == True)
141
- a/b/ (exists == False)
142
- a/c/ (exists == False)
143
- a/d/ (exists == False)
144
- f/4.txt (exists == True)
145
- ```
146
-
147
- Parameters
148
- ----------
149
- keys : Iterable[str], optional, default None
150
- List of paths.
151
-
152
- Returns
153
- -------
154
- List[S3Object]
155
- S3Objects under the given paths, including prefixes (directories) that
156
- do not correspond to leaf objects.
157
- """
158
- ...
159
- def list_recursive(self, keys: typing.Optional[typing.Iterable[str]] = None) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
160
- """
161
- List all objects recursively under the given prefixes.
162
-
163
- If multiple keys are specified, listings are done in parallel. All objects
164
- returned have `.exists == True` as this call always returns leaf objects.
165
-
166
- For instance, if the directory hierarchy is
167
- ```
168
- a/0.txt
169
- a/b/1.txt
170
- a/c/2.txt
171
- a/d/e/3.txt
172
- f/4.txt
173
- ```
174
- The `list_paths(['a', 'f'])` call returns
175
- ```
176
- a/0.txt (exists == True)
177
- a/b/1.txt (exists == True)
178
- a/c/2.txt (exists == True)
179
- a/d/e/3.txt (exists == True)
180
- f/4.txt (exists == True)
181
- ```
182
-
183
- Parameters
184
- ----------
185
- keys : Iterable[str], optional, default None
186
- List of paths.
187
-
188
- Returns
189
- -------
190
- List[S3Object]
191
- S3Objects under the given paths.
192
- """
193
- ...
194
- def info(self, key: typing.Optional[str] = None, return_missing: bool = False) -> metaflow.plugins.datatools.s3.s3.S3Object:
195
- """
196
- Get metadata about a single object in S3.
197
-
198
- This call makes a single `HEAD` request to S3 which can be
199
- much faster than downloading all data with `get`.
200
-
201
- Parameters
202
- ----------
203
- key : str, optional, default None
204
- Object to query. It can be an S3 url or a path suffix.
205
- return_missing : bool, default False
206
- If set to True, do not raise an exception for a missing key but
207
- return it as an `S3Object` with `.exists == False`.
208
-
209
- Returns
210
- -------
211
- S3Object
212
- An S3Object corresponding to the object requested. The object
213
- will have `.downloaded == False`.
214
- """
215
- ...
216
- def info_many(self, keys: typing.Iterable[str], return_missing: bool = False) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
217
- """
218
- Get metadata about many objects in S3 in parallel.
219
-
220
- This call makes a single `HEAD` request to S3 which can be
221
- much faster than downloading all data with `get`.
222
-
223
- Parameters
224
- ----------
225
- keys : Iterable[str]
226
- Objects to query. Each key can be an S3 url or a path suffix.
227
- return_missing : bool, default False
228
- If set to True, do not raise an exception for a missing key but
229
- return it as an `S3Object` with `.exists == False`.
230
-
231
- Returns
232
- -------
233
- List[S3Object]
234
- A list of S3Objects corresponding to the paths requested. The
235
- objects will have `.downloaded == False`.
236
- """
237
- ...
238
- def get(self, key: typing.Union[str, metaflow.plugins.datatools.s3.s3.S3GetObject, None] = None, return_missing: bool = False, return_info: bool = True) -> metaflow.plugins.datatools.s3.s3.S3Object:
239
- """
240
- Get a single object from S3.
241
-
242
- Parameters
243
- ----------
244
- key : Union[str, S3GetObject], optional, default None
245
- Object to download. It can be an S3 url, a path suffix, or
246
- an S3GetObject that defines a range of data to download. If None, or
247
- not provided, gets the S3 root.
248
- return_missing : bool, default False
249
- If set to True, do not raise an exception for a missing key but
250
- return it as an `S3Object` with `.exists == False`.
251
- return_info : bool, default True
252
- If set to True, fetch the content-type and user metadata associated
253
- with the object at no extra cost, included for symmetry with `get_many`
254
-
255
- Returns
256
- -------
257
- S3Object
258
- An S3Object corresponding to the object requested.
259
- """
260
- ...
261
- def get_many(self, keys: typing.Iterable[typing.Union[str, metaflow.plugins.datatools.s3.s3.S3GetObject]], return_missing: bool = False, return_info: bool = True) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
262
- """
263
- Get many objects from S3 in parallel.
264
-
265
- Parameters
266
- ----------
267
- keys : Iterable[Union[str, S3GetObject]]
268
- Objects to download. Each object can be an S3 url, a path suffix, or
269
- an S3GetObject that defines a range of data to download.
270
- return_missing : bool, default False
271
- If set to True, do not raise an exception for a missing key but
272
- return it as an `S3Object` with `.exists == False`.
273
- return_info : bool, default True
274
- If set to True, fetch the content-type and user metadata associated
275
- with the object at no extra cost, included for symmetry with `get_many`.
276
-
277
- Returns
278
- -------
279
- List[S3Object]
280
- S3Objects corresponding to the objects requested.
281
- """
282
- ...
283
- def get_recursive(self, keys: typing.Iterable[str], return_info: bool = False) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
284
- """
285
- Get many objects from S3 recursively in parallel.
286
-
287
- Parameters
288
- ----------
289
- keys : Iterable[str]
290
- Prefixes to download recursively. Each prefix can be an S3 url or a path suffix
291
- which define the root prefix under which all objects are downloaded.
292
- return_info : bool, default False
293
- If set to True, fetch the content-type and user metadata associated
294
- with the object.
295
-
296
- Returns
297
- -------
298
- List[S3Object]
299
- S3Objects stored under the given prefixes.
300
- """
301
- ...
302
- def get_all(self, return_info: bool = False) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
303
- """
304
- Get all objects under the prefix set in the `S3` constructor.
305
-
306
- This method requires that the `S3` object is initialized either with `run` or
307
- `s3root`.
308
-
309
- Parameters
310
- ----------
311
- return_info : bool, default False
312
- If set to True, fetch the content-type and user metadata associated
313
- with the object.
314
-
315
- Returns
316
- -------
317
- Iterable[S3Object]
318
- S3Objects stored under the main prefix.
319
- """
320
- ...
321
- def put(self, key: typing.Union[str, metaflow.plugins.datatools.s3.s3.S3PutObject], obj: typing.Union[io.RawIOBase, io.BufferedIOBase, str, bytes], overwrite: bool = True, content_type: typing.Optional[str] = None, metadata: typing.Optional[typing.Dict[str, str]] = None) -> str:
322
- """
323
- Upload a single object to S3.
324
-
325
- Parameters
326
- ----------
327
- key : Union[str, S3PutObject]
328
- Object path. It can be an S3 url or a path suffix.
329
- obj : PutValue
330
- An object to store in S3. Strings are converted to UTF-8 encoding.
331
- overwrite : bool, default True
332
- Overwrite the object if it exists. If set to False, the operation
333
- succeeds without uploading anything if the key already exists.
334
- content_type : str, optional, default None
335
- Optional MIME type for the object.
336
- metadata : Dict[str, str], optional, default None
337
- A JSON-encodable dictionary of additional headers to be stored
338
- as metadata with the object.
339
-
340
- Returns
341
- -------
342
- str
343
- URL of the object stored.
344
- """
345
- ...
346
- def put_many(self, key_objs: typing.List[typing.Union[typing.Tuple[str, typing.Union[io.RawIOBase, io.BufferedIOBase, str, bytes]], metaflow.plugins.datatools.s3.s3.S3PutObject]], overwrite: bool = True) -> typing.List[typing.Tuple[str, str]]:
347
- """
348
- Upload many objects to S3.
349
-
350
- Each object to be uploaded can be specified in two ways:
351
-
352
- 1. As a `(key, obj)` tuple where `key` is a string specifying
353
- the path and `obj` is a string or a bytes object.
354
-
355
- 2. As a `S3PutObject` which contains additional metadata to be
356
- stored with the object.
357
-
358
- Parameters
359
- ----------
360
- key_objs : List[Union[Tuple[str, PutValue], S3PutObject]]
361
- List of key-object pairs to upload.
362
- overwrite : bool, default True
363
- Overwrite the object if it exists. If set to False, the operation
364
- succeeds without uploading anything if the key already exists.
365
-
366
- Returns
367
- -------
368
- List[Tuple[str, str]]
369
- List of `(key, url)` pairs corresponding to the objects uploaded.
370
- """
371
- ...
372
- def put_files(self, key_paths: typing.List[typing.Union[typing.Tuple[str, typing.Union[io.RawIOBase, io.BufferedIOBase, str, bytes]], metaflow.plugins.datatools.s3.s3.S3PutObject]], overwrite: bool = True) -> typing.List[typing.Tuple[str, str]]:
373
- """
374
- Upload many local files to S3.
375
-
376
- Each file to be uploaded can be specified in two ways:
377
-
378
- 1. As a `(key, path)` tuple where `key` is a string specifying
379
- the S3 path and `path` is the path to a local file.
380
-
381
- 2. As a `S3PutObject` which contains additional metadata to be
382
- stored with the file.
383
-
384
- Parameters
385
- ----------
386
- key_paths : List[Union[Tuple[str, PutValue], S3PutObject]]
387
- List of files to upload.
388
- overwrite : bool, default True
389
- Overwrite the object if it exists. If set to False, the operation
390
- succeeds without uploading anything if the key already exists.
391
-
392
- Returns
393
- -------
394
- List[Tuple[str, str]]
395
- List of `(key, url)` pairs corresponding to the files uploaded.
396
- """
397
- ...
18
+ def read_in_chunks(dst, src, src_sz, max_chunk_size):
398
19
  ...
399
20
 
@@ -1,21 +1,17 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.475726 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.613575 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
+ import metaflow
9
10
  import typing
10
11
  if typing.TYPE_CHECKING:
11
12
  import metaflow.exception
12
13
 
13
- class MetaflowException(Exception, metaclass=type):
14
- def __init__(self, msg = "", lineno = None):
15
- ...
16
- def __str__(self):
17
- ...
18
- ...
14
+ from ...exception import MetaflowException as MetaflowException
19
15
 
20
16
  DATATOOLS_LOCALROOT: None
21
17