ob-metaflow-stubs 2.11.4.1__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 (131) hide show
  1. metaflow-stubs/__init__.pyi +2753 -0
  2. metaflow-stubs/cards.pyi +266 -0
  3. metaflow-stubs/cli.pyi +137 -0
  4. metaflow-stubs/client/__init__.pyi +993 -0
  5. metaflow-stubs/client/core.pyi +1425 -0
  6. metaflow-stubs/client/filecache.pyi +87 -0
  7. metaflow-stubs/events.pyi +107 -0
  8. metaflow-stubs/exception.pyi +98 -0
  9. metaflow-stubs/flowspec.pyi +297 -0
  10. metaflow-stubs/generated_for.txt +1 -0
  11. metaflow-stubs/includefile.pyi +524 -0
  12. metaflow-stubs/metadata/metadata.pyi +377 -0
  13. metaflow-stubs/metadata/util.pyi +18 -0
  14. metaflow-stubs/metaflow_config.pyi +263 -0
  15. metaflow-stubs/metaflow_current.pyi +327 -0
  16. metaflow-stubs/mflog/mflog.pyi +22 -0
  17. metaflow-stubs/multicore_utils.pyi +62 -0
  18. metaflow-stubs/parameters.pyi +114 -0
  19. metaflow-stubs/plugins/__init__.pyi +209 -0
  20. metaflow-stubs/plugins/airflow/__init__.pyi +9 -0
  21. metaflow-stubs/plugins/airflow/airflow.pyi +179 -0
  22. metaflow-stubs/plugins/airflow/airflow_cli.pyi +90 -0
  23. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +50 -0
  24. metaflow-stubs/plugins/airflow/airflow_utils.pyi +137 -0
  25. metaflow-stubs/plugins/airflow/exception.pyi +27 -0
  26. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +26 -0
  27. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +60 -0
  28. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +54 -0
  29. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +50 -0
  30. metaflow-stubs/plugins/argo/__init__.pyi +9 -0
  31. metaflow-stubs/plugins/argo/argo_client.pyi +77 -0
  32. metaflow-stubs/plugins/argo/argo_events.pyi +79 -0
  33. metaflow-stubs/plugins/argo/argo_workflows.pyi +604 -0
  34. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +180 -0
  35. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +169 -0
  36. metaflow-stubs/plugins/aws/__init__.pyi +9 -0
  37. metaflow-stubs/plugins/aws/aws_client.pyi +22 -0
  38. metaflow-stubs/plugins/aws/aws_utils.pyi +93 -0
  39. metaflow-stubs/plugins/aws/batch/__init__.pyi +9 -0
  40. metaflow-stubs/plugins/aws/batch/batch.pyi +120 -0
  41. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +42 -0
  42. metaflow-stubs/plugins/aws/batch/batch_client.pyi +159 -0
  43. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +145 -0
  44. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +9 -0
  45. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +73 -0
  46. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +9 -0
  47. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +22 -0
  48. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +27 -0
  49. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +18 -0
  50. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +17 -0
  51. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +220 -0
  52. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +139 -0
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +36 -0
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +49 -0
  55. metaflow-stubs/plugins/azure/__init__.pyi +9 -0
  56. metaflow-stubs/plugins/azure/azure_credential.pyi +28 -0
  57. metaflow-stubs/plugins/azure/azure_exceptions.pyi +28 -0
  58. metaflow-stubs/plugins/azure/azure_utils.pyi +76 -0
  59. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +52 -0
  60. metaflow-stubs/plugins/azure/includefile_support.pyi +63 -0
  61. metaflow-stubs/plugins/cards/__init__.pyi +9 -0
  62. metaflow-stubs/plugins/cards/card_cli.pyi +557 -0
  63. metaflow-stubs/plugins/cards/card_client.pyi +178 -0
  64. metaflow-stubs/plugins/cards/card_creator.pyi +26 -0
  65. metaflow-stubs/plugins/cards/card_datastore.pyi +111 -0
  66. metaflow-stubs/plugins/cards/card_decorator.pyi +133 -0
  67. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +67 -0
  68. metaflow-stubs/plugins/cards/card_modules/basic.pyi +263 -0
  69. metaflow-stubs/plugins/cards/card_modules/card.pyi +62 -0
  70. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +78 -0
  71. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +77 -0
  72. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +11 -0
  73. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +114 -0
  74. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +75 -0
  75. metaflow-stubs/plugins/cards/card_modules/components.pyi +251 -0
  76. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +45 -0
  77. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +24 -0
  78. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +155 -0
  79. metaflow-stubs/plugins/cards/card_resolver.pyi +60 -0
  80. metaflow-stubs/plugins/cards/component_serializer.pyi +227 -0
  81. metaflow-stubs/plugins/cards/exception.pyi +71 -0
  82. metaflow-stubs/plugins/catch_decorator.pyi +58 -0
  83. metaflow-stubs/plugins/datatools/__init__.pyi +339 -0
  84. metaflow-stubs/plugins/datatools/local.pyi +82 -0
  85. metaflow-stubs/plugins/datatools/s3/__init__.pyi +589 -0
  86. metaflow-stubs/plugins/datatools/s3/s3.pyi +875 -0
  87. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +34 -0
  88. metaflow-stubs/plugins/datatools/s3/s3util.pyi +45 -0
  89. metaflow-stubs/plugins/debug_logger.pyi +25 -0
  90. metaflow-stubs/plugins/debug_monitor.pyi +25 -0
  91. metaflow-stubs/plugins/environment_decorator.pyi +17 -0
  92. metaflow-stubs/plugins/events_decorator.pyi +34 -0
  93. metaflow-stubs/plugins/frameworks/__init__.pyi +9 -0
  94. metaflow-stubs/plugins/frameworks/pytorch.pyi +42 -0
  95. metaflow-stubs/plugins/gcp/__init__.pyi +9 -0
  96. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +22 -0
  97. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +26 -0
  98. metaflow-stubs/plugins/gcp/gs_utils.pyi +38 -0
  99. metaflow-stubs/plugins/gcp/includefile_support.pyi +63 -0
  100. metaflow-stubs/plugins/kubernetes/__init__.pyi +9 -0
  101. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +127 -0
  102. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +73 -0
  103. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +62 -0
  104. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +165 -0
  105. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +100 -0
  106. metaflow-stubs/plugins/package_cli.pyi +9 -0
  107. metaflow-stubs/plugins/parallel_decorator.pyi +34 -0
  108. metaflow-stubs/plugins/project_decorator.pyi +36 -0
  109. metaflow-stubs/plugins/pypi/__init__.pyi +18 -0
  110. metaflow-stubs/plugins/pypi/conda_decorator.pyi +59 -0
  111. metaflow-stubs/plugins/pypi/conda_environment.pyi +86 -0
  112. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +22 -0
  113. metaflow-stubs/plugins/pypi/pypi_environment.pyi +50 -0
  114. metaflow-stubs/plugins/pypi/utils.pyi +28 -0
  115. metaflow-stubs/plugins/resources_decorator.pyi +15 -0
  116. metaflow-stubs/plugins/retry_decorator.pyi +28 -0
  117. metaflow-stubs/plugins/secrets/__init__.pyi +21 -0
  118. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +30 -0
  119. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +75 -0
  120. metaflow-stubs/plugins/storage_executor.pyi +33 -0
  121. metaflow-stubs/plugins/tag_cli.pyi +370 -0
  122. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +54 -0
  123. metaflow-stubs/plugins/timeout_decorator.pyi +39 -0
  124. metaflow-stubs/procpoll.pyi +51 -0
  125. metaflow-stubs/py.typed +0 -0
  126. metaflow-stubs/pylint_wrapper.pyi +31 -0
  127. metaflow-stubs/tagging_util.pyi +52 -0
  128. ob_metaflow_stubs-2.11.4.1.dist-info/METADATA +22 -0
  129. ob_metaflow_stubs-2.11.4.1.dist-info/RECORD +131 -0
  130. ob_metaflow_stubs-2.11.4.1.dist-info/WHEEL +6 -0
  131. ob_metaflow_stubs-2.11.4.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,993 @@
1
+ ##################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.11.4.1 #
4
+ # Generated on 2024-02-28T05:30:43.922605 #
5
+ ##################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import typing
10
+ if typing.TYPE_CHECKING:
11
+ import metaflow.client.core
12
+ import metaflow.events
13
+ import datetime
14
+ import typing
15
+
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
+ def __init__(self):
123
+ ...
124
+ @property
125
+ def flows(self) -> typing.List[metaflow.client.core.Flow]:
126
+ """
127
+ Returns a list of all the flows present.
128
+
129
+ Only flows present in the set namespace are returned. A flow is present in a namespace if
130
+ it has at least one run that is in the namespace.
131
+
132
+ Returns
133
+ -------
134
+ List[Flow]
135
+ List of all flows present.
136
+ """
137
+ ...
138
+ def __iter__(self) -> typing.Iterator[metaflow.client.core.Flow]:
139
+ """
140
+ Iterator over all flows present.
141
+
142
+ Only flows present in the set namespace are returned. A flow is present in a
143
+ namespace if it has at least one run that is in the namespace.
144
+
145
+ Yields
146
+ -------
147
+ Flow
148
+ A Flow present in the Metaflow universe.
149
+ """
150
+ ...
151
+ def __str__(self) -> str:
152
+ ...
153
+ def __getitem__(self, name: str) -> metaflow.client.core.Flow:
154
+ """
155
+ Returns a specific flow by name.
156
+
157
+ The flow will only be returned if it is present in the current namespace.
158
+
159
+ Parameters
160
+ ----------
161
+ name : str
162
+ Name of the Flow
163
+
164
+ Returns
165
+ -------
166
+ Flow
167
+ Flow with the given name.
168
+ """
169
+ ...
170
+ ...
171
+
172
+ class Flow(metaflow.client.core.MetaflowObject, metaclass=type):
173
+ def __init__(self, *args, **kwargs):
174
+ ...
175
+ @property
176
+ def latest_run(self) -> typing.Optional[metaflow.client.core.Run]:
177
+ """
178
+ Returns the latest run (either in progress or completed) of this flow.
179
+
180
+ Note that an in-progress run may be returned by this call. Use latest_successful_run
181
+ to get an object representing a completed successful run.
182
+
183
+ Returns
184
+ -------
185
+ Run, optional
186
+ Latest run of this flow
187
+ """
188
+ ...
189
+ @property
190
+ def latest_successful_run(self) -> typing.Optional[metaflow.client.core.Run]:
191
+ """
192
+ Returns the latest successful run of this flow.
193
+
194
+ Returns
195
+ -------
196
+ Run, optional
197
+ Latest successful run of this flow
198
+ """
199
+ ...
200
+ def runs(self, *tags: str) -> typing.Iterator[metaflow.client.core.Run]:
201
+ """
202
+ Returns an iterator over all `Run`s of this flow.
203
+
204
+ An optional filter is available that allows you to filter on tags.
205
+ If multiple tags are specified, only runs that have all the
206
+ specified tags are returned.
207
+
208
+ Parameters
209
+ ----------
210
+ tags : str
211
+ Tags to match.
212
+
213
+ Yields
214
+ ------
215
+ Run
216
+ `Run` objects in this flow.
217
+ """
218
+ ...
219
+ def __iter__(self) -> typing.Iterator[metaflow.client.core.Task]:
220
+ """
221
+ Iterate over all children Run of this Flow.
222
+
223
+ Note that only runs in the current namespace are returned unless
224
+ _namespace_check is False
225
+
226
+ Yields
227
+ ------
228
+ Run
229
+ A Run in this Flow
230
+ """
231
+ ...
232
+ def __getitem__(self, run_id: str) -> metaflow.client.core.Run:
233
+ """
234
+ Returns the Run object with the run ID 'run_id'
235
+
236
+ Parameters
237
+ ----------
238
+ run_id : str
239
+ Run OD
240
+
241
+ Returns
242
+ -------
243
+ Run
244
+ Run for this run ID in this Flow
245
+
246
+ Raises
247
+ ------
248
+ KeyError
249
+ If the run_id does not identify a valid Run object
250
+ """
251
+ ...
252
+ def __getstate__(self):
253
+ ...
254
+ def __setstate__(self, state):
255
+ ...
256
+ ...
257
+
258
+ class Run(metaflow.client.core.MetaflowObject, metaclass=type):
259
+ def steps(self, *tags: str) -> typing.Iterator[metaflow.client.core.Step]:
260
+ """
261
+ [Legacy function - do not use]
262
+
263
+ Returns an iterator over all `Step` objects in the step. This is an alias
264
+ to iterating the object itself, i.e.
265
+ ```
266
+ list(Run(...)) == list(Run(...).steps())
267
+ ```
268
+
269
+ Parameters
270
+ ----------
271
+ tags : str
272
+ No op (legacy functionality)
273
+
274
+ Yields
275
+ ------
276
+ Step
277
+ `Step` objects in this run.
278
+ """
279
+ ...
280
+ @property
281
+ def code(self) -> typing.Optional[metaflow.client.core.MetaflowCode]:
282
+ """
283
+ Returns the MetaflowCode object for this run, if present.
284
+ Code is packed if atleast one `Step` runs remotely, else None is returned.
285
+
286
+ Returns
287
+ -------
288
+ MetaflowCode, optional
289
+ Code package for this run
290
+ """
291
+ ...
292
+ @property
293
+ def data(self) -> typing.Optional[metaflow.client.core.MetaflowData]:
294
+ """
295
+ Returns a container of data artifacts produced by this run.
296
+
297
+ You can access data produced by this run as follows:
298
+ ```
299
+ print(run.data.my_var)
300
+ ```
301
+ This is a shorthand for `run['end'].task.data`. If the 'end' step has not yet
302
+ executed, returns None.
303
+
304
+ Returns
305
+ -------
306
+ MetaflowData, optional
307
+ Container of all artifacts produced by this task
308
+ """
309
+ ...
310
+ @property
311
+ def successful(self) -> bool:
312
+ """
313
+ Indicates whether or not the run completed successfully.
314
+
315
+ A run is successful if its 'end' step is successful.
316
+
317
+ Returns
318
+ -------
319
+ bool
320
+ True if the run completed successfully and False otherwise
321
+ """
322
+ ...
323
+ @property
324
+ def finished(self) -> bool:
325
+ """
326
+ Indicates whether or not the run completed.
327
+
328
+ A run completed if its 'end' step completed.
329
+
330
+ Returns
331
+ -------
332
+ bool
333
+ True if the run completed and False otherwise
334
+ """
335
+ ...
336
+ @property
337
+ def finished_at(self) -> typing.Optional[datetime.datetime]:
338
+ """
339
+ Returns the datetime object of when the run finished (successfully or not).
340
+
341
+ The completion time of a run is the same as the completion time of its 'end' step.
342
+ If the 'end' step has not completed, returns None.
343
+
344
+ Returns
345
+ -------
346
+ datetime, optional
347
+ Datetime of when the run finished
348
+ """
349
+ ...
350
+ @property
351
+ def end_task(self) -> typing.Optional[metaflow.client.core.Task]:
352
+ """
353
+ Returns the Task corresponding to the 'end' step.
354
+
355
+ This returns None if the end step does not yet exist.
356
+
357
+ Returns
358
+ -------
359
+ Task, optional
360
+ The 'end' task
361
+ """
362
+ ...
363
+ def add_tag(self, tag: str):
364
+ """
365
+ Add a tag to this `Run`.
366
+
367
+ Note that if the tag is already a system tag, it is not added as a user tag,
368
+ and no error is thrown.
369
+
370
+ Parameters
371
+ ----------
372
+ tag : str
373
+ Tag to add.
374
+ """
375
+ ...
376
+ def add_tags(self, tags: typing.Iterable[str]):
377
+ """
378
+ Add one or more tags to this `Run`.
379
+
380
+ Note that if any tag is already a system tag, it is not added as a user tag
381
+ and no error is thrown.
382
+
383
+ Parameters
384
+ ----------
385
+ tags : Iterable[str]
386
+ Tags to add.
387
+ """
388
+ ...
389
+ def remove_tag(self, tag: str):
390
+ """
391
+ Remove one tag from this `Run`.
392
+
393
+ Removing a system tag is an error. Removing a non-existent
394
+ user tag is a no-op.
395
+
396
+ Parameters
397
+ ----------
398
+ tag : str
399
+ Tag to remove.
400
+ """
401
+ ...
402
+ def remove_tags(self, tags: typing.Iterable[str]):
403
+ """
404
+ Remove one or more tags to this `Run`.
405
+
406
+ Removing a system tag will result in an error. Removing a non-existent
407
+ user tag is a no-op.
408
+
409
+ Parameters
410
+ ----------
411
+ tags : Iterable[str]
412
+ Tags to remove.
413
+ """
414
+ ...
415
+ def replace_tag(self, tag_to_remove: str, tag_to_add: str):
416
+ """
417
+ Remove a tag and add a tag atomically. Removal is done first.
418
+ The rules for `Run.add_tag` and `Run.remove_tag` also apply here.
419
+
420
+ Parameters
421
+ ----------
422
+ tag_to_remove : str
423
+ Tag to remove.
424
+ tag_to_add : str
425
+ Tag to add.
426
+ """
427
+ ...
428
+ def replace_tags(self, tags_to_remove: typing.Iterable[str], tags_to_add: typing.Iterable[str]):
429
+ """
430
+ Remove and add tags atomically; the removal is done first.
431
+ The rules for `Run.add_tag` and `Run.remove_tag` also apply here.
432
+
433
+ Parameters
434
+ ----------
435
+ tags_to_remove : Iterable[str]
436
+ Tags to remove.
437
+ tags_to_add : Iterable[str]
438
+ Tags to add.
439
+ """
440
+ ...
441
+ def __iter__(self) -> typing.Iterator[metaflow.client.core.Step]:
442
+ """
443
+ Iterate over all children Step of this Run
444
+
445
+ Yields
446
+ ------
447
+ Step
448
+ A Step in this Run
449
+ """
450
+ ...
451
+ def __getitem__(self, name: str) -> metaflow.client.core.Step:
452
+ """
453
+ Returns the Step object with the step name 'name'
454
+
455
+ Parameters
456
+ ----------
457
+ name : str
458
+ Step name
459
+
460
+ Returns
461
+ -------
462
+ Step
463
+ Step for this step name in this Run
464
+
465
+ Raises
466
+ ------
467
+ KeyError
468
+ If the name does not identify a valid Step object
469
+ """
470
+ ...
471
+ def __getstate__(self):
472
+ ...
473
+ def __setstate__(self, state):
474
+ ...
475
+ @property
476
+ def trigger(self) -> typing.Optional[metaflow.events.Trigger]:
477
+ """
478
+ Returns a container of events that triggered this run.
479
+
480
+ This returns None if the run was not triggered by any events.
481
+
482
+ Returns
483
+ -------
484
+ Trigger, optional
485
+ Container of triggering events
486
+ """
487
+ ...
488
+ ...
489
+
490
+ class Step(metaflow.client.core.MetaflowObject, metaclass=type):
491
+ @property
492
+ def task(self) -> typing.Optional[metaflow.client.core.Task]:
493
+ """
494
+ Returns a Task object belonging to this step.
495
+
496
+ This is useful when the step only contains one task (a linear step for example).
497
+
498
+ Returns
499
+ -------
500
+ Task
501
+ A task in the step
502
+ """
503
+ ...
504
+ def tasks(self, *tags: str) -> typing.Iterable[metaflow.client.core.Task]:
505
+ """
506
+ [Legacy function - do not use]
507
+
508
+ Returns an iterator over all `Task` objects in the step. This is an alias
509
+ to iterating the object itself, i.e.
510
+ ```
511
+ list(Step(...)) == list(Step(...).tasks())
512
+ ```
513
+
514
+ Parameters
515
+ ----------
516
+ tags : str
517
+ No op (legacy functionality)
518
+
519
+ Yields
520
+ ------
521
+ Task
522
+ `Task` objects in this step.
523
+ """
524
+ ...
525
+ @property
526
+ def control_task(self) -> typing.Optional[metaflow.client.core.Task]:
527
+ """
528
+ [Unpublished API - use with caution!]
529
+
530
+ Returns a Control Task object belonging to this step.
531
+ This is useful when the step only contains one control task.
532
+
533
+ Returns
534
+ -------
535
+ Task
536
+ A control task in the step
537
+ """
538
+ ...
539
+ def control_tasks(self, *tags: str) -> typing.Iterator[metaflow.client.core.Task]:
540
+ """
541
+ [Unpublished API - use with caution!]
542
+
543
+ Returns an iterator over all the control tasks in the step.
544
+ An optional filter is available that allows you to filter on tags. The
545
+ control tasks returned if the filter is specified will contain all the
546
+ tags specified.
547
+ Parameters
548
+ ----------
549
+ tags : str
550
+ Tags to match
551
+
552
+ Yields
553
+ ------
554
+ Task
555
+ Control Task objects for this step
556
+ """
557
+ ...
558
+ def __iter__(self) -> typing.Iterator[metaflow.client.core.Task]:
559
+ """
560
+ Iterate over all children Task of this Step
561
+
562
+ Yields
563
+ ------
564
+ Task
565
+ A Task in this Step
566
+ """
567
+ ...
568
+ def __getitem__(self, task_id: str) -> metaflow.client.core.Task:
569
+ """
570
+ Returns the Task object with the task ID 'task_id'
571
+
572
+ Parameters
573
+ ----------
574
+ task_id : str
575
+ Task ID
576
+
577
+ Returns
578
+ -------
579
+ Task
580
+ Task for this task ID in this Step
581
+
582
+ Raises
583
+ ------
584
+ KeyError
585
+ If the task_id does not identify a valid Task object
586
+ """
587
+ ...
588
+ def __getstate__(self):
589
+ ...
590
+ def __setstate__(self, state):
591
+ ...
592
+ @property
593
+ def finished_at(self) -> typing.Optional[datetime.datetime]:
594
+ """
595
+ Returns the datetime object of when the step finished (successfully or not).
596
+
597
+ A step is considered finished when all the tasks that belong to it have
598
+ finished. This call will return None if the step has not finished
599
+
600
+ Returns
601
+ -------
602
+ datetime
603
+ Datetime of when the step finished
604
+ """
605
+ ...
606
+ @property
607
+ def environment_info(self) -> typing.Optional[typing.Dict[str, typing.Any]]:
608
+ """
609
+ Returns information about the environment that was used to execute this step. As an
610
+ example, if the Conda environment is selected, this will return information about the
611
+ dependencies that were used in the environment.
612
+
613
+ This environment information is only available for steps that have tasks
614
+ for which the code package has been saved.
615
+
616
+ Returns
617
+ -------
618
+ Dict[str, Any], optional
619
+ Dictionary describing the environment
620
+ """
621
+ ...
622
+ ...
623
+
624
+ class Task(metaflow.client.core.MetaflowObject, metaclass=type):
625
+ def __init__(self, *args, **kwargs):
626
+ ...
627
+ @property
628
+ def metadata(self) -> typing.List[metaflow.client.core.Metadata]:
629
+ """
630
+ Metadata events produced by this task across all attempts of the task
631
+ *except* if you selected a specific task attempt.
632
+
633
+ Note that Metadata is different from tags.
634
+
635
+ Returns
636
+ -------
637
+ List[Metadata]
638
+ Metadata produced by this task
639
+ """
640
+ ...
641
+ @property
642
+ def metadata_dict(self) -> typing.Dict[str, str]:
643
+ """
644
+ Dictionary mapping metadata names (keys) and their associated values.
645
+
646
+ Note that unlike the metadata() method, this call will only return the latest
647
+ metadata for a given name. For example, if a task executes multiple times (retries),
648
+ the same metadata name will be generated multiple times (one for each execution of the
649
+ task). The metadata() method returns all those metadata elements whereas this call will
650
+ return the metadata associated with the latest execution of the task.
651
+
652
+ Returns
653
+ -------
654
+ Dict[str, str]
655
+ Dictionary mapping metadata name with value
656
+ """
657
+ ...
658
+ @property
659
+ def index(self) -> typing.Optional[int]:
660
+ """
661
+ Returns the index of the innermost foreach loop if this task is run inside at least
662
+ one foreach.
663
+
664
+ The index is what distinguishes the various tasks inside a given step.
665
+ This call returns None if this task was not run in a foreach loop.
666
+
667
+ Returns
668
+ -------
669
+ int, optional
670
+ Index in the innermost loop for this task
671
+ """
672
+ ...
673
+ @property
674
+ def data(self) -> metaflow.client.core.MetaflowData:
675
+ """
676
+ Returns a container of data artifacts produced by this task.
677
+
678
+ You can access data produced by this task as follows:
679
+ ```
680
+ print(task.data.my_var)
681
+ ```
682
+
683
+ Returns
684
+ -------
685
+ MetaflowData
686
+ Container of all artifacts produced by this task
687
+ """
688
+ ...
689
+ @property
690
+ def artifacts(self) -> typing.NamedTuple:
691
+ """
692
+ Returns a container of DataArtifacts produced by this task.
693
+
694
+ You can access each DataArtifact by name like so:
695
+ ```
696
+ print(task.artifacts.my_var)
697
+ ```
698
+ This method differs from data() because it returns DataArtifact objects
699
+ (which contain additional metadata) as opposed to just the data.
700
+
701
+ Returns
702
+ -------
703
+ MetaflowArtifacts
704
+ Container of all DataArtifacts produced by this task
705
+ """
706
+ ...
707
+ @property
708
+ def successful(self) -> bool:
709
+ """
710
+ Indicates whether or not the task completed successfully.
711
+
712
+ This information is always about the latest task to have completed (in case
713
+ of retries).
714
+
715
+ Returns
716
+ -------
717
+ bool
718
+ True if the task completed successfully and False otherwise
719
+ """
720
+ ...
721
+ @property
722
+ def finished(self) -> bool:
723
+ """
724
+ Indicates whether or not the task completed.
725
+
726
+ This information is always about the latest task to have completed (in case
727
+ of retries).
728
+
729
+ Returns
730
+ -------
731
+ bool
732
+ True if the task completed and False otherwise
733
+ """
734
+ ...
735
+ @property
736
+ def exception(self) -> typing.Optional[typing.Any]:
737
+ """
738
+ Returns the exception that caused the task to fail, if any.
739
+
740
+ This information is always about the latest task to have completed (in case
741
+ of retries). If successful() returns False and finished() returns True,
742
+ this method can help determine what went wrong.
743
+
744
+ Returns
745
+ -------
746
+ object
747
+ Exception raised by the task or None if not applicable
748
+ """
749
+ ...
750
+ @property
751
+ def finished_at(self) -> typing.Optional[datetime.datetime]:
752
+ """
753
+ Returns the datetime object of when the task finished (successfully or not).
754
+
755
+ This information is always about the latest task to have completed (in case
756
+ of retries). This call will return None if the task is not finished.
757
+
758
+ Returns
759
+ -------
760
+ datetime
761
+ Datetime of when the task finished
762
+ """
763
+ ...
764
+ @property
765
+ def runtime_name(self) -> typing.Optional[str]:
766
+ """
767
+ Returns the name of the runtime this task executed on.
768
+
769
+
770
+ Returns
771
+ -------
772
+ str
773
+ Name of the runtime this task executed on
774
+ """
775
+ ...
776
+ @property
777
+ def stdout(self) -> str:
778
+ """
779
+ Returns the full standard out of this task.
780
+
781
+ If you specify a specific attempt for this task, it will return the
782
+ standard out for that attempt. If you do not specify an attempt,
783
+ this will return the current standard out for the latest *started*
784
+ attempt of the task. In both cases, multiple calls to this
785
+ method will return the most up-to-date log (so if an attempt is not
786
+ done, each call will fetch the latest log).
787
+
788
+ Returns
789
+ -------
790
+ str
791
+ Standard output of this task
792
+ """
793
+ ...
794
+ @property
795
+ def stdout_size(self) -> int:
796
+ """
797
+ Returns the size of the stdout log of this task.
798
+
799
+ Similar to `stdout`, the size returned is the latest size of the log
800
+ (so for a running attempt, this value will increase as the task produces
801
+ more output).
802
+
803
+ Returns
804
+ -------
805
+ int
806
+ Size of the stdout log content (in bytes)
807
+ """
808
+ ...
809
+ @property
810
+ def stderr(self) -> str:
811
+ """
812
+ Returns the full standard error of this task.
813
+
814
+ If you specify a specific attempt for this task, it will return the
815
+ standard error for that attempt. If you do not specify an attempt,
816
+ this will return the current standard error for the latest *started*
817
+ attempt. In both cases, multiple calls to this
818
+ method will return the most up-to-date log (so if an attempt is not
819
+ done, each call will fetch the latest log).
820
+
821
+ Returns
822
+ -------
823
+ str
824
+ Standard error of this task
825
+ """
826
+ ...
827
+ @property
828
+ def stderr_size(self) -> int:
829
+ """
830
+ Returns the size of the stderr log of this task.
831
+
832
+ Similar to `stderr`, the size returned is the latest size of the log
833
+ (so for a running attempt, this value will increase as the task produces
834
+ more output).
835
+
836
+ Returns
837
+ -------
838
+ int
839
+ Size of the stderr log content (in bytes)
840
+ """
841
+ ...
842
+ @property
843
+ def current_attempt(self) -> int:
844
+ """
845
+ Get the relevant attempt for this Task.
846
+
847
+ Returns the specific attempt used when
848
+ initializing the instance, or the latest *started* attempt for the Task.
849
+
850
+ Returns
851
+ -------
852
+ int
853
+ attempt id for this task object
854
+ """
855
+ ...
856
+ @property
857
+ def code(self) -> typing.Optional[metaflow.client.core.MetaflowCode]:
858
+ """
859
+ Returns the MetaflowCode object for this task, if present.
860
+
861
+ Not all tasks save their code so this call may return None in those cases.
862
+
863
+ Returns
864
+ -------
865
+ MetaflowCode
866
+ Code package for this task
867
+ """
868
+ ...
869
+ @property
870
+ def environment_info(self) -> typing.Dict[str, typing.Any]:
871
+ """
872
+ Returns information about the environment that was used to execute this task. As an
873
+ example, if the Conda environment is selected, this will return information about the
874
+ dependencies that were used in the environment.
875
+
876
+ This environment information is only available for tasks that have a code package.
877
+
878
+ Returns
879
+ -------
880
+ Dict
881
+ Dictionary describing the environment
882
+ """
883
+ ...
884
+ 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]]:
885
+ """
886
+ Return an iterator over (utc_timestamp, logline) tuples.
887
+
888
+ Parameters
889
+ ----------
890
+ stream : str
891
+ Either 'stdout' or 'stderr'.
892
+ as_unicode : bool, default: True
893
+ If as_unicode=False, each logline is returned as a byte object. Otherwise,
894
+ it is returned as a (unicode) string.
895
+
896
+ Yields
897
+ ------
898
+ Tuple[datetime, str]
899
+ Tuple of timestamp, logline pairs.
900
+ """
901
+ ...
902
+ def __iter__(self) -> typing.Iterator[metaflow.client.core.DataArtifact]:
903
+ """
904
+ Iterate over all children DataArtifact of this Task
905
+
906
+ Yields
907
+ ------
908
+ DataArtifact
909
+ A DataArtifact in this Step
910
+ """
911
+ ...
912
+ def __getitem__(self, name: str) -> metaflow.client.core.DataArtifact:
913
+ """
914
+ Returns the DataArtifact object with the artifact name 'name'
915
+
916
+ Parameters
917
+ ----------
918
+ name : str
919
+ Data artifact name
920
+
921
+ Returns
922
+ -------
923
+ DataArtifact
924
+ DataArtifact for this artifact name in this task
925
+
926
+ Raises
927
+ ------
928
+ KeyError
929
+ If the name does not identify a valid DataArtifact object
930
+ """
931
+ ...
932
+ def __getstate__(self):
933
+ ...
934
+ def __setstate__(self, state):
935
+ ...
936
+ ...
937
+
938
+ class DataArtifact(metaflow.client.core.MetaflowObject, metaclass=type):
939
+ @property
940
+ def data(self) -> typing.Any:
941
+ """
942
+ Unpickled representation of the data contained in this artifact.
943
+
944
+ Returns
945
+ -------
946
+ object
947
+ Object contained in this artifact
948
+ """
949
+ ...
950
+ @property
951
+ def size(self) -> int:
952
+ """
953
+ Returns the size (in bytes) of the pickled object representing this
954
+ DataArtifact
955
+
956
+ Returns
957
+ -------
958
+ int
959
+ size of the pickled representation of data artifact (in bytes)
960
+ """
961
+ ...
962
+ @property
963
+ def sha(self) -> str:
964
+ """
965
+ Unique identifier for this artifact.
966
+
967
+ This is a unique hash of the artifact (historically SHA1 hash)
968
+
969
+ Returns
970
+ -------
971
+ str
972
+ Hash of this artifact
973
+ """
974
+ ...
975
+ @property
976
+ def finished_at(self) -> datetime.datetime:
977
+ """
978
+ Creation time for this artifact.
979
+
980
+ Alias for created_at.
981
+
982
+ Returns
983
+ -------
984
+ datetime
985
+ Creation time
986
+ """
987
+ ...
988
+ def __getstate__(self):
989
+ ...
990
+ def __setstate__(self, state):
991
+ ...
992
+ ...
993
+