metaflow-stubs 2.12.28__py2.py3-none-any.whl → 2.12.30__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 +279 -2983
  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 +19 -159
  6. metaflow-stubs/client/filecache.pyi +7 -11
  7. metaflow-stubs/clone_util.pyi +6 -26
  8. metaflow-stubs/events.pyi +7 -6
  9. metaflow-stubs/exception.pyi +8 -6
  10. metaflow-stubs/flowspec.pyi +21 -105
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +17 -565
  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 +32 -31
  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 +12 -22
  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 +17 -121
  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 +14 -76
  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 +13 -96
  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 +24 -107
  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 +9 -29
  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 +15 -263
  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 +10 -9
  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 +13 -19
  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 +7 -11
  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 +23 -507
  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.30.dist-info}/METADATA +2 -2
  155. metaflow_stubs-2.12.30.dist-info/RECORD +158 -0
  156. {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.30.dist-info}/WHEEL +1 -1
  157. metaflow-stubs/metadata/util.pyi +0 -18
  158. metaflow_stubs-2.12.28.dist-info/RECORD +0 -152
  159. {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.30.dist-info}/top_level.txt +0 -0
@@ -1,1118 +1,24 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.462944 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.30 #
4
+ # Generated on 2024-11-13T13:50:31.296741 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- import typing
10
- if typing.TYPE_CHECKING:
11
- import metaflow.client.core
12
- import metaflow.events
13
- import typing
14
- import datetime
15
9
 
16
- def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
17
- """
18
- Switch namespace to the one provided.
19
-
20
- This call has a global effect. No objects outside this namespace
21
- will be accessible. To access all objects regardless of namespaces,
22
- pass None to this call.
23
-
24
- Parameters
25
- ----------
26
- ns : str, optional
27
- Namespace to switch to or None to ignore namespaces.
28
-
29
- Returns
30
- -------
31
- str, optional
32
- Namespace set (result of get_namespace()).
33
- """
34
- ...
35
-
36
- def get_namespace() -> typing.Optional[str]:
37
- """
38
- Return the current namespace that is currently being used to filter objects.
39
-
40
- The namespace is a tag associated with all objects in Metaflow.
41
-
42
- Returns
43
- -------
44
- str, optional
45
- The current namespace used to filter objects.
46
- """
47
- ...
48
-
49
- def default_namespace() -> str:
50
- """
51
- Resets the namespace used to filter objects to the default one, i.e. the one that was
52
- used prior to any `namespace` calls.
53
-
54
- Returns
55
- -------
56
- str
57
- The result of get_namespace() after the namespace has been reset.
58
- """
59
- ...
60
-
61
- def metadata(ms: str) -> str:
62
- """
63
- Switch Metadata provider.
64
-
65
- This call has a global effect. Selecting the local metadata will,
66
- for example, not allow access to information stored in remote
67
- metadata providers.
68
-
69
- Note that you don't typically have to call this function directly. Usually
70
- the metadata provider is set through the Metaflow configuration file. If you
71
- need to switch between multiple providers, you can use the `METAFLOW_PROFILE`
72
- environment variable to switch between configurations.
73
-
74
- Parameters
75
- ----------
76
- ms : str
77
- Can be a path (selects local metadata), a URL starting with http (selects
78
- the service metadata) or an explicit specification <metadata_type>@<info>; as an
79
- example, you can specify local@<path> or service@<url>.
80
-
81
- Returns
82
- -------
83
- str
84
- The description of the metadata selected (equivalent to the result of
85
- get_metadata()).
86
- """
87
- ...
88
-
89
- def get_metadata() -> str:
90
- """
91
- Returns the current Metadata provider.
92
-
93
- If this is not set explicitly using `metadata`, the default value is
94
- determined through the Metaflow configuration. You can use this call to
95
- check that your configuration is set up properly.
96
-
97
- If multiple configuration profiles are present, this call returns the one
98
- selected through the `METAFLOW_PROFILE` environment variable.
99
-
100
- Returns
101
- -------
102
- str
103
- Information about the Metadata provider currently selected. This information typically
104
- returns provider specific information (like URL for remote providers or local paths for
105
- local providers).
106
- """
107
- ...
108
-
109
- def default_metadata() -> str:
110
- """
111
- Resets the Metadata provider to the default value, that is, to the value
112
- that was used prior to any `metadata` calls.
113
-
114
- Returns
115
- -------
116
- str
117
- The result of get_metadata() after resetting the provider.
118
- """
119
- ...
120
-
121
- class Metaflow(object, metaclass=type):
122
- """
123
- Entry point to all objects in the Metaflow universe.
124
-
125
- This object can be used to list all the flows present either through the explicit property
126
- or by iterating over this object.
127
-
128
- Attributes
129
- ----------
130
- flows : List[Flow]
131
- Returns the list of all `Flow` objects known to this metadata provider. Note that only
132
- flows present in the current namespace will be returned. A `Flow` is present in a namespace
133
- if it has at least one run in the namespace.
134
- """
135
- def __init__(self, _current_metadata: typing.Optional[str] = None):
136
- ...
137
- @property
138
- def flows(self) -> typing.List[metaflow.client.core.Flow]:
139
- """
140
- Returns a list of all the flows present.
141
-
142
- Only flows present in the set namespace are returned. A flow is present in a namespace if
143
- it has at least one run that is in the namespace.
144
-
145
- Returns
146
- -------
147
- List[Flow]
148
- List of all flows present.
149
- """
150
- ...
151
- def __iter__(self) -> typing.Iterator[metaflow.client.core.Flow]:
152
- """
153
- Iterator over all flows present.
154
-
155
- Only flows present in the set namespace are returned. A flow is present in a
156
- namespace if it has at least one run that is in the namespace.
157
-
158
- Yields
159
- -------
160
- Flow
161
- A Flow present in the Metaflow universe.
162
- """
163
- ...
164
- def __str__(self) -> str:
165
- ...
166
- def __getitem__(self, name: str) -> metaflow.client.core.Flow:
167
- """
168
- Returns a specific flow by name.
169
-
170
- The flow will only be returned if it is present in the current namespace.
171
-
172
- Parameters
173
- ----------
174
- name : str
175
- Name of the Flow
176
-
177
- Returns
178
- -------
179
- Flow
180
- Flow with the given name.
181
- """
182
- ...
183
- ...
184
-
185
- class Flow(metaflow.client.core.MetaflowObject, metaclass=type):
186
- """
187
- A Flow represents all existing flows with a certain name, in other words,
188
- classes derived from `FlowSpec`. A container of `Run` objects.
189
-
190
- Attributes
191
- ----------
192
- latest_run : Run
193
- Latest `Run` (in progress or completed, successfully or not) of this flow.
194
- latest_successful_run : Run
195
- Latest successfully completed `Run` of this flow.
196
- """
197
- def __init__(self, *args, **kwargs):
198
- ...
199
- @property
200
- def latest_run(self) -> typing.Optional[metaflow.client.core.Run]:
201
- """
202
- Returns the latest run (either in progress or completed) of this flow.
203
-
204
- Note that an in-progress run may be returned by this call. Use latest_successful_run
205
- to get an object representing a completed successful run.
206
-
207
- Returns
208
- -------
209
- Run, optional
210
- Latest run of this flow
211
- """
212
- ...
213
- @property
214
- def latest_successful_run(self) -> typing.Optional[metaflow.client.core.Run]:
215
- """
216
- Returns the latest successful run of this flow.
217
-
218
- Returns
219
- -------
220
- Run, optional
221
- Latest successful run of this flow
222
- """
223
- ...
224
- def runs(self, *tags: str) -> typing.Iterator[metaflow.client.core.Run]:
225
- """
226
- Returns an iterator over all `Run`s of this flow.
227
-
228
- An optional filter is available that allows you to filter on tags.
229
- If multiple tags are specified, only runs that have all the
230
- specified tags are returned.
231
-
232
- Parameters
233
- ----------
234
- tags : str
235
- Tags to match.
236
-
237
- Yields
238
- ------
239
- Run
240
- `Run` objects in this flow.
241
- """
242
- ...
243
- def __iter__(self) -> typing.Iterator[metaflow.client.core.Task]:
244
- """
245
- Iterate over all children Run of this Flow.
246
-
247
- Note that only runs in the current namespace are returned unless
248
- _namespace_check is False
249
-
250
- Yields
251
- ------
252
- Run
253
- A Run in this Flow
254
- """
255
- ...
256
- def __getitem__(self, run_id: str) -> metaflow.client.core.Run:
257
- """
258
- Returns the Run object with the run ID 'run_id'
259
-
260
- Parameters
261
- ----------
262
- run_id : str
263
- Run OD
264
-
265
- Returns
266
- -------
267
- Run
268
- Run for this run ID in this Flow
269
-
270
- Raises
271
- ------
272
- KeyError
273
- If the run_id does not identify a valid Run object
274
- """
275
- ...
276
- def __getstate__(self):
277
- ...
278
- def __setstate__(self, state):
279
- ...
280
- ...
281
-
282
- class Run(metaflow.client.core.MetaflowObject, metaclass=type):
283
- """
284
- A `Run` represents an execution of a `Flow`. It is a container of `Step`s.
285
-
286
- Attributes
287
- ----------
288
- data : MetaflowData
289
- a shortcut to run['end'].task.data, i.e. data produced by this run.
290
- successful : bool
291
- True if the run completed successfully.
292
- finished : bool
293
- True if the run completed.
294
- finished_at : datetime
295
- Time this run finished.
296
- code : MetaflowCode
297
- Code package for this run (if present). See `MetaflowCode`.
298
- trigger : MetaflowTrigger
299
- Information about event(s) that triggered this run (if present). See `MetaflowTrigger`.
300
- end_task : Task
301
- `Task` for the end step (if it is present already).
302
- """
303
- def steps(self, *tags: str) -> typing.Iterator[metaflow.client.core.Step]:
304
- """
305
- [Legacy function - do not use]
306
-
307
- Returns an iterator over all `Step` objects in the step. This is an alias
308
- to iterating the object itself, i.e.
309
- ```
310
- list(Run(...)) == list(Run(...).steps())
311
- ```
312
-
313
- Parameters
314
- ----------
315
- tags : str
316
- No op (legacy functionality)
317
-
318
- Yields
319
- ------
320
- Step
321
- `Step` objects in this run.
322
- """
323
- ...
324
- @property
325
- def code(self) -> typing.Optional[metaflow.client.core.MetaflowCode]:
326
- """
327
- Returns the MetaflowCode object for this run, if present.
328
- Code is packed if atleast one `Step` runs remotely, else None is returned.
329
-
330
- Returns
331
- -------
332
- MetaflowCode, optional
333
- Code package for this run
334
- """
335
- ...
336
- @property
337
- def data(self) -> typing.Optional[metaflow.client.core.MetaflowData]:
338
- """
339
- Returns a container of data artifacts produced by this run.
340
-
341
- You can access data produced by this run as follows:
342
- ```
343
- print(run.data.my_var)
344
- ```
345
- This is a shorthand for `run['end'].task.data`. If the 'end' step has not yet
346
- executed, returns None.
347
-
348
- Returns
349
- -------
350
- MetaflowData, optional
351
- Container of all artifacts produced by this task
352
- """
353
- ...
354
- @property
355
- def successful(self) -> bool:
356
- """
357
- Indicates whether or not the run completed successfully.
358
-
359
- A run is successful if its 'end' step is successful.
360
-
361
- Returns
362
- -------
363
- bool
364
- True if the run completed successfully and False otherwise
365
- """
366
- ...
367
- @property
368
- def finished(self) -> bool:
369
- """
370
- Indicates whether or not the run completed.
371
-
372
- A run completed if its 'end' step completed.
373
-
374
- Returns
375
- -------
376
- bool
377
- True if the run completed and False otherwise
378
- """
379
- ...
380
- @property
381
- def finished_at(self) -> typing.Optional[datetime.datetime]:
382
- """
383
- Returns the datetime object of when the run finished (successfully or not).
384
-
385
- The completion time of a run is the same as the completion time of its 'end' step.
386
- If the 'end' step has not completed, returns None.
387
-
388
- Returns
389
- -------
390
- datetime, optional
391
- Datetime of when the run finished
392
- """
393
- ...
394
- @property
395
- def end_task(self) -> typing.Optional[metaflow.client.core.Task]:
396
- """
397
- Returns the Task corresponding to the 'end' step.
398
-
399
- This returns None if the end step does not yet exist.
400
-
401
- Returns
402
- -------
403
- Task, optional
404
- The 'end' task
405
- """
406
- ...
407
- def add_tag(self, tag: str):
408
- """
409
- Add a tag to this `Run`.
410
-
411
- Note that if the tag is already a system tag, it is not added as a user tag,
412
- and no error is thrown.
413
-
414
- Parameters
415
- ----------
416
- tag : str
417
- Tag to add.
418
- """
419
- ...
420
- def add_tags(self, tags: typing.Iterable[str]):
421
- """
422
- Add one or more tags to this `Run`.
423
-
424
- Note that if any tag is already a system tag, it is not added as a user tag
425
- and no error is thrown.
426
-
427
- Parameters
428
- ----------
429
- tags : Iterable[str]
430
- Tags to add.
431
- """
432
- ...
433
- def remove_tag(self, tag: str):
434
- """
435
- Remove one tag from this `Run`.
436
-
437
- Removing a system tag is an error. Removing a non-existent
438
- user tag is a no-op.
439
-
440
- Parameters
441
- ----------
442
- tag : str
443
- Tag to remove.
444
- """
445
- ...
446
- def remove_tags(self, tags: typing.Iterable[str]):
447
- """
448
- Remove one or more tags to this `Run`.
449
-
450
- Removing a system tag will result in an error. Removing a non-existent
451
- user tag is a no-op.
452
-
453
- Parameters
454
- ----------
455
- tags : Iterable[str]
456
- Tags to remove.
457
- """
458
- ...
459
- def replace_tag(self, tag_to_remove: str, tag_to_add: str):
460
- """
461
- Remove a tag and add a tag atomically. Removal is done first.
462
- The rules for `Run.add_tag` and `Run.remove_tag` also apply here.
463
-
464
- Parameters
465
- ----------
466
- tag_to_remove : str
467
- Tag to remove.
468
- tag_to_add : str
469
- Tag to add.
470
- """
471
- ...
472
- def replace_tags(self, tags_to_remove: typing.Iterable[str], tags_to_add: typing.Iterable[str]):
473
- """
474
- Remove and add tags atomically; the removal is done first.
475
- The rules for `Run.add_tag` and `Run.remove_tag` also apply here.
476
-
477
- Parameters
478
- ----------
479
- tags_to_remove : Iterable[str]
480
- Tags to remove.
481
- tags_to_add : Iterable[str]
482
- Tags to add.
483
- """
484
- ...
485
- def __iter__(self) -> typing.Iterator[metaflow.client.core.Step]:
486
- """
487
- Iterate over all children Step of this Run
488
-
489
- Yields
490
- ------
491
- Step
492
- A Step in this Run
493
- """
494
- ...
495
- def __getitem__(self, name: str) -> metaflow.client.core.Step:
496
- """
497
- Returns the Step object with the step name 'name'
498
-
499
- Parameters
500
- ----------
501
- name : str
502
- Step name
503
-
504
- Returns
505
- -------
506
- Step
507
- Step for this step name in this Run
508
-
509
- Raises
510
- ------
511
- KeyError
512
- If the name does not identify a valid Step object
513
- """
514
- ...
515
- def __getstate__(self):
516
- ...
517
- def __setstate__(self, state):
518
- ...
519
- @property
520
- def trigger(self) -> typing.Optional[metaflow.events.Trigger]:
521
- """
522
- Returns a container of events that triggered this run.
523
-
524
- This returns None if the run was not triggered by any events.
525
-
526
- Returns
527
- -------
528
- Trigger, optional
529
- Container of triggering events
530
- """
531
- ...
532
- ...
533
-
534
- class Step(metaflow.client.core.MetaflowObject, metaclass=type):
535
- """
536
- A `Step` represents a user-defined step, that is, a method annotated with the `@step` decorator.
537
-
538
- It contains `Task` objects associated with the step, that is, all executions of the
539
- `Step`. The step may contain multiple `Task`s in the case of a foreach step.
540
-
541
- Attributes
542
- ----------
543
- task : Task
544
- The first `Task` object in this step. This is a shortcut for retrieving the only
545
- task contained in a non-foreach step.
546
- finished_at : datetime
547
- Time when the latest `Task` of this step finished. Note that in the case of foreaches,
548
- this time may change during execution of the step.
549
- environment_info : Dict[str, Any]
550
- Information about the execution environment.
551
- """
552
- @property
553
- def task(self) -> typing.Optional[metaflow.client.core.Task]:
554
- """
555
- Returns a Task object belonging to this step.
556
-
557
- This is useful when the step only contains one task (a linear step for example).
558
-
559
- Returns
560
- -------
561
- Task
562
- A task in the step
563
- """
564
- ...
565
- def tasks(self, *tags: str) -> typing.Iterable[metaflow.client.core.Task]:
566
- """
567
- [Legacy function - do not use]
568
-
569
- Returns an iterator over all `Task` objects in the step. This is an alias
570
- to iterating the object itself, i.e.
571
- ```
572
- list(Step(...)) == list(Step(...).tasks())
573
- ```
574
-
575
- Parameters
576
- ----------
577
- tags : str
578
- No op (legacy functionality)
579
-
580
- Yields
581
- ------
582
- Task
583
- `Task` objects in this step.
584
- """
585
- ...
586
- @property
587
- def control_task(self) -> typing.Optional[metaflow.client.core.Task]:
588
- """
589
- [Unpublished API - use with caution!]
590
-
591
- Returns a Control Task object belonging to this step.
592
- This is useful when the step only contains one control task.
593
-
594
- Returns
595
- -------
596
- Task
597
- A control task in the step
598
- """
599
- ...
600
- def control_tasks(self, *tags: str) -> typing.Iterator[metaflow.client.core.Task]:
601
- """
602
- [Unpublished API - use with caution!]
603
-
604
- Returns an iterator over all the control tasks in the step.
605
- An optional filter is available that allows you to filter on tags. The
606
- control tasks returned if the filter is specified will contain all the
607
- tags specified.
608
- Parameters
609
- ----------
610
- tags : str
611
- Tags to match
612
-
613
- Yields
614
- ------
615
- Task
616
- Control Task objects for this step
617
- """
618
- ...
619
- def __iter__(self) -> typing.Iterator[metaflow.client.core.Task]:
620
- """
621
- Iterate over all children Task of this Step
622
-
623
- Yields
624
- ------
625
- Task
626
- A Task in this Step
627
- """
628
- ...
629
- def __getitem__(self, task_id: str) -> metaflow.client.core.Task:
630
- """
631
- Returns the Task object with the task ID 'task_id'
632
-
633
- Parameters
634
- ----------
635
- task_id : str
636
- Task ID
637
-
638
- Returns
639
- -------
640
- Task
641
- Task for this task ID in this Step
642
-
643
- Raises
644
- ------
645
- KeyError
646
- If the task_id does not identify a valid Task object
647
- """
648
- ...
649
- def __getstate__(self):
650
- ...
651
- def __setstate__(self, state):
652
- ...
653
- @property
654
- def finished_at(self) -> typing.Optional[datetime.datetime]:
655
- """
656
- Returns the datetime object of when the step finished (successfully or not).
657
-
658
- A step is considered finished when all the tasks that belong to it have
659
- finished. This call will return None if the step has not finished
660
-
661
- Returns
662
- -------
663
- datetime
664
- Datetime of when the step finished
665
- """
666
- ...
667
- @property
668
- def environment_info(self) -> typing.Optional[typing.Dict[str, typing.Any]]:
669
- """
670
- Returns information about the environment that was used to execute this step. As an
671
- example, if the Conda environment is selected, this will return information about the
672
- dependencies that were used in the environment.
673
-
674
- This environment information is only available for steps that have tasks
675
- for which the code package has been saved.
676
-
677
- Returns
678
- -------
679
- Dict[str, Any], optional
680
- Dictionary describing the environment
681
- """
682
- ...
683
- ...
684
-
685
- class Task(metaflow.client.core.MetaflowObject, metaclass=type):
686
- """
687
- A `Task` represents an execution of a `Step`.
688
-
689
- It contains all `DataArtifact` objects produced by the task as
690
- well as metadata related to execution.
691
-
692
- Note that the `@retry` decorator may cause multiple attempts of
693
- the task to be present. Usually you want the latest attempt, which
694
- is what instantiating a `Task` object returns by default. If
695
- you need to e.g. retrieve logs from a failed attempt, you can
696
- explicitly get information about a specific attempt by using the
697
- following syntax when creating a task:
698
-
699
- `Task('flow/run/step/task', attempt=<attempt>)`
700
-
701
- where `attempt=0` corresponds to the first attempt etc.
702
-
703
- Attributes
704
- ----------
705
- metadata : List[Metadata]
706
- List of all metadata events associated with the task.
707
- metadata_dict : Dict[str, str]
708
- A condensed version of `metadata`: A dictionary where keys
709
- are names of metadata events and values the latest corresponding event.
710
- data : MetaflowData
711
- Container of all data artifacts produced by this task. Note that this
712
- call downloads all data locally, so it can be slower than accessing
713
- artifacts individually. See `MetaflowData` for more information.
714
- artifacts : MetaflowArtifacts
715
- Container of `DataArtifact` objects produced by this task.
716
- successful : bool
717
- True if the task completed successfully.
718
- finished : bool
719
- True if the task completed.
720
- exception : object
721
- Exception raised by this task if there was one.
722
- finished_at : datetime
723
- Time this task finished.
724
- runtime_name : str
725
- Runtime this task was executed on.
726
- stdout : str
727
- Standard output for the task execution.
728
- stderr : str
729
- Standard error output for the task execution.
730
- code : MetaflowCode
731
- Code package for this task (if present). See `MetaflowCode`.
732
- environment_info : Dict[str, str]
733
- Information about the execution environment.
734
- """
735
- def __init__(self, *args, **kwargs):
736
- ...
737
- @property
738
- def metadata(self) -> typing.List[metaflow.client.core.Metadata]:
739
- """
740
- Metadata events produced by this task across all attempts of the task
741
- *except* if you selected a specific task attempt.
742
-
743
- Note that Metadata is different from tags.
744
-
745
- Returns
746
- -------
747
- List[Metadata]
748
- Metadata produced by this task
749
- """
750
- ...
751
- @property
752
- def metadata_dict(self) -> typing.Dict[str, str]:
753
- """
754
- Dictionary mapping metadata names (keys) and their associated values.
755
-
756
- Note that unlike the metadata() method, this call will only return the latest
757
- metadata for a given name. For example, if a task executes multiple times (retries),
758
- the same metadata name will be generated multiple times (one for each execution of the
759
- task). The metadata() method returns all those metadata elements whereas this call will
760
- return the metadata associated with the latest execution of the task.
761
-
762
- Returns
763
- -------
764
- Dict[str, str]
765
- Dictionary mapping metadata name with value
766
- """
767
- ...
768
- @property
769
- def index(self) -> typing.Optional[int]:
770
- """
771
- Returns the index of the innermost foreach loop if this task is run inside at least
772
- one foreach.
773
-
774
- The index is what distinguishes the various tasks inside a given step.
775
- This call returns None if this task was not run in a foreach loop.
776
-
777
- Returns
778
- -------
779
- int, optional
780
- Index in the innermost loop for this task
781
- """
782
- ...
783
- @property
784
- def data(self) -> metaflow.client.core.MetaflowData:
785
- """
786
- Returns a container of data artifacts produced by this task.
787
-
788
- You can access data produced by this task as follows:
789
- ```
790
- print(task.data.my_var)
791
- ```
792
-
793
- Returns
794
- -------
795
- MetaflowData
796
- Container of all artifacts produced by this task
797
- """
798
- ...
799
- @property
800
- def artifacts(self) -> typing.NamedTuple:
801
- """
802
- Returns a container of DataArtifacts produced by this task.
803
-
804
- You can access each DataArtifact by name like so:
805
- ```
806
- print(task.artifacts.my_var)
807
- ```
808
- This method differs from data() because it returns DataArtifact objects
809
- (which contain additional metadata) as opposed to just the data.
810
-
811
- Returns
812
- -------
813
- MetaflowArtifacts
814
- Container of all DataArtifacts produced by this task
815
- """
816
- ...
817
- @property
818
- def successful(self) -> bool:
819
- """
820
- Indicates whether or not the task completed successfully.
821
-
822
- This information is always about the latest task to have completed (in case
823
- of retries).
824
-
825
- Returns
826
- -------
827
- bool
828
- True if the task completed successfully and False otherwise
829
- """
830
- ...
831
- @property
832
- def finished(self) -> bool:
833
- """
834
- Indicates whether or not the task completed.
835
-
836
- This information is always about the latest task to have completed (in case
837
- of retries).
838
-
839
- Returns
840
- -------
841
- bool
842
- True if the task completed and False otherwise
843
- """
844
- ...
845
- @property
846
- def exception(self) -> typing.Optional[typing.Any]:
847
- """
848
- Returns the exception that caused the task to fail, if any.
849
-
850
- This information is always about the latest task to have completed (in case
851
- of retries). If successful() returns False and finished() returns True,
852
- this method can help determine what went wrong.
853
-
854
- Returns
855
- -------
856
- object
857
- Exception raised by the task or None if not applicable
858
- """
859
- ...
860
- @property
861
- def finished_at(self) -> typing.Optional[datetime.datetime]:
862
- """
863
- Returns the datetime object of when the task finished (successfully or not).
864
-
865
- This information is always about the latest task to have completed (in case
866
- of retries). This call will return None if the task is not finished.
867
-
868
- Returns
869
- -------
870
- datetime
871
- Datetime of when the task finished
872
- """
873
- ...
874
- @property
875
- def runtime_name(self) -> typing.Optional[str]:
876
- """
877
- Returns the name of the runtime this task executed on.
878
-
879
-
880
- Returns
881
- -------
882
- str
883
- Name of the runtime this task executed on
884
- """
885
- ...
886
- @property
887
- def stdout(self) -> str:
888
- """
889
- Returns the full standard out of this task.
890
-
891
- If you specify a specific attempt for this task, it will return the
892
- standard out for that attempt. If you do not specify an attempt,
893
- this will return the current standard out for the latest *started*
894
- attempt of the task. In both cases, multiple calls to this
895
- method will return the most up-to-date log (so if an attempt is not
896
- done, each call will fetch the latest log).
897
-
898
- Returns
899
- -------
900
- str
901
- Standard output of this task
902
- """
903
- ...
904
- @property
905
- def stdout_size(self) -> int:
906
- """
907
- Returns the size of the stdout log of this task.
908
-
909
- Similar to `stdout`, the size returned is the latest size of the log
910
- (so for a running attempt, this value will increase as the task produces
911
- more output).
912
-
913
- Returns
914
- -------
915
- int
916
- Size of the stdout log content (in bytes)
917
- """
918
- ...
919
- @property
920
- def stderr(self) -> str:
921
- """
922
- Returns the full standard error of this task.
923
-
924
- If you specify a specific attempt for this task, it will return the
925
- standard error for that attempt. If you do not specify an attempt,
926
- this will return the current standard error for the latest *started*
927
- attempt. In both cases, multiple calls to this
928
- method will return the most up-to-date log (so if an attempt is not
929
- done, each call will fetch the latest log).
930
-
931
- Returns
932
- -------
933
- str
934
- Standard error of this task
935
- """
936
- ...
937
- @property
938
- def stderr_size(self) -> int:
939
- """
940
- Returns the size of the stderr log of this task.
941
-
942
- Similar to `stderr`, the size returned is the latest size of the log
943
- (so for a running attempt, this value will increase as the task produces
944
- more output).
945
-
946
- Returns
947
- -------
948
- int
949
- Size of the stderr log content (in bytes)
950
- """
951
- ...
952
- @property
953
- def current_attempt(self) -> int:
954
- """
955
- Get the relevant attempt for this Task.
956
-
957
- Returns the specific attempt used when
958
- initializing the instance, or the latest *started* attempt for the Task.
959
-
960
- Returns
961
- -------
962
- int
963
- attempt id for this task object
964
- """
965
- ...
966
- @property
967
- def code(self) -> typing.Optional[metaflow.client.core.MetaflowCode]:
968
- """
969
- Returns the MetaflowCode object for this task, if present.
970
-
971
- Not all tasks save their code so this call may return None in those cases.
972
-
973
- Returns
974
- -------
975
- MetaflowCode
976
- Code package for this task
977
- """
978
- ...
979
- @property
980
- def environment_info(self) -> typing.Dict[str, typing.Any]:
981
- """
982
- Returns information about the environment that was used to execute this task. As an
983
- example, if the Conda environment is selected, this will return information about the
984
- dependencies that were used in the environment.
985
-
986
- This environment information is only available for tasks that have a code package.
987
-
988
- Returns
989
- -------
990
- Dict
991
- Dictionary describing the environment
992
- """
993
- ...
994
- def loglines(self, stream: str, as_unicode: bool = True, meta_dict: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Iterator[typing.Tuple[datetime.datetime, str]]:
995
- """
996
- Return an iterator over (utc_timestamp, logline) tuples.
997
-
998
- Parameters
999
- ----------
1000
- stream : str
1001
- Either 'stdout' or 'stderr'.
1002
- as_unicode : bool, default: True
1003
- If as_unicode=False, each logline is returned as a byte object. Otherwise,
1004
- it is returned as a (unicode) string.
1005
-
1006
- Yields
1007
- ------
1008
- Tuple[datetime, str]
1009
- Tuple of timestamp, logline pairs.
1010
- """
1011
- ...
1012
- def __iter__(self) -> typing.Iterator[metaflow.client.core.DataArtifact]:
1013
- """
1014
- Iterate over all children DataArtifact of this Task
1015
-
1016
- Yields
1017
- ------
1018
- DataArtifact
1019
- A DataArtifact in this Step
1020
- """
1021
- ...
1022
- def __getitem__(self, name: str) -> metaflow.client.core.DataArtifact:
1023
- """
1024
- Returns the DataArtifact object with the artifact name 'name'
1025
-
1026
- Parameters
1027
- ----------
1028
- name : str
1029
- Data artifact name
1030
-
1031
- Returns
1032
- -------
1033
- DataArtifact
1034
- DataArtifact for this artifact name in this task
1035
-
1036
- Raises
1037
- ------
1038
- KeyError
1039
- If the name does not identify a valid DataArtifact object
1040
- """
1041
- ...
1042
- def __getstate__(self):
1043
- ...
1044
- def __setstate__(self, state):
1045
- ...
1046
- ...
1047
-
1048
- class DataArtifact(metaflow.client.core.MetaflowObject, metaclass=type):
1049
- """
1050
- A single data artifact and associated metadata. Note that this object does
1051
- not contain other objects as it is the leaf object in the hierarchy.
1052
-
1053
- Attributes
1054
- ----------
1055
- data : object
1056
- The data contained in this artifact, that is, the object produced during
1057
- execution of this run.
1058
- sha : string
1059
- A unique ID of this artifact.
1060
- finished_at : datetime
1061
- Corresponds roughly to the `Task.finished_at` time of the parent `Task`.
1062
- An alias for `DataArtifact.created_at`.
1063
- """
1064
- @property
1065
- def data(self) -> typing.Any:
1066
- """
1067
- Unpickled representation of the data contained in this artifact.
1068
-
1069
- Returns
1070
- -------
1071
- object
1072
- Object contained in this artifact
1073
- """
1074
- ...
1075
- @property
1076
- def size(self) -> int:
1077
- """
1078
- Returns the size (in bytes) of the pickled object representing this
1079
- DataArtifact
1080
-
1081
- Returns
1082
- -------
1083
- int
1084
- size of the pickled representation of data artifact (in bytes)
1085
- """
1086
- ...
1087
- @property
1088
- def sha(self) -> str:
1089
- """
1090
- Unique identifier for this artifact.
1091
-
1092
- This is a unique hash of the artifact (historically SHA1 hash)
1093
-
1094
- Returns
1095
- -------
1096
- str
1097
- Hash of this artifact
1098
- """
1099
- ...
1100
- @property
1101
- def finished_at(self) -> datetime.datetime:
1102
- """
1103
- Creation time for this artifact.
1104
-
1105
- Alias for created_at.
1106
-
1107
- Returns
1108
- -------
1109
- datetime
1110
- Creation time
1111
- """
1112
- ...
1113
- def __getstate__(self):
1114
- ...
1115
- def __setstate__(self, state):
1116
- ...
1117
- ...
10
+ from . import filecache as filecache
11
+ from . import core as core
12
+ from .core import namespace as namespace
13
+ from .core import get_namespace as get_namespace
14
+ from .core import default_namespace as default_namespace
15
+ from .core import metadata as metadata
16
+ from .core import get_metadata as get_metadata
17
+ from .core import default_metadata as default_metadata
18
+ from .core import Metaflow as Metaflow
19
+ from .core import Flow as Flow
20
+ from .core import Run as Run
21
+ from .core import Step as Step
22
+ from .core import Task as Task
23
+ from .core import DataArtifact as DataArtifact
1118
24