metaflow-stubs 2.12.8__py2.py3-none-any.whl → 2.12.9__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.
- metaflow-stubs/__init__.pyi +535 -486
- metaflow-stubs/cards.pyi +6 -6
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +3 -3
- metaflow-stubs/client/core.pyi +7 -7
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/clone_util.pyi +2 -2
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +5 -5
- metaflow-stubs/metadata/metadata.pyi +2 -2
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +32 -9
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +3 -3
- metaflow-stubs/plugins/__init__.pyi +7 -3
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +5 -5
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +3 -3
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +3 -3
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +38 -5
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +270 -5
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +228 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +292 -0
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +24 -4
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +260 -0
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_cli.pyi +3 -3
- metaflow-stubs/plugins/cards/card_client.pyi +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -6
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +3 -3
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +5 -3
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +18 -10
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +12 -12
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +26 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +14 -31
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +26 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +82 -28
- metaflow-stubs/plugins/logs_cli.pyi +4 -4
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +47 -2
- metaflow-stubs/plugins/project_decorator.pyi +3 -3
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +3 -3
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +4 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +26 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +354 -0
- metaflow-stubs/runner/metaflow_runner.pyi +10 -10
- metaflow-stubs/runner/nbdeploy.pyi +54 -0
- metaflow-stubs/runner/nbrun.pyi +7 -7
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +25 -0
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.12.8.dist-info → metaflow_stubs-2.12.9.dist-info}/METADATA +2 -2
- metaflow_stubs-2.12.9.dist-info/RECORD +150 -0
- {metaflow_stubs-2.12.8.dist-info → metaflow_stubs-2.12.9.dist-info}/WHEEL +1 -1
- metaflow_stubs-2.12.8.dist-info/RECORD +0 -145
- {metaflow_stubs-2.12.8.dist-info → metaflow_stubs-2.12.9.dist-info}/top_level.txt +0 -0
@@ -1,17 +1,18 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-07-
|
3
|
+
# MF version: 2.12.9 #
|
4
|
+
# Generated on 2024-07-25T18:20:16.325569 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow._vendor.click.types
|
12
11
|
import metaflow.parameters
|
13
|
-
import metaflow.exception
|
14
12
|
import metaflow.metaflow_current
|
13
|
+
import metaflow._vendor.click.types
|
14
|
+
import metaflow.graph
|
15
|
+
import metaflow.exception
|
15
16
|
|
16
17
|
inf: float
|
17
18
|
|
@@ -103,6 +104,10 @@ SERVICE_INTERNAL_URL: None
|
|
103
104
|
|
104
105
|
UI_URL: None
|
105
106
|
|
107
|
+
UBF_CONTROL: str
|
108
|
+
|
109
|
+
UBF_TASK: str
|
110
|
+
|
106
111
|
BASH_SAVE_LOGS: str
|
107
112
|
|
108
113
|
def deploy_time_eval(value):
|
@@ -123,6 +128,32 @@ def validate_kube_labels(labels: typing.Optional[typing.Dict[str, typing.Optiona
|
|
123
128
|
"""
|
124
129
|
...
|
125
130
|
|
131
|
+
class KubernetesArgoJobSet(object, metaclass=type):
|
132
|
+
def __init__(self, kubernetes_sdk, name = None, namespace = None, **kwargs):
|
133
|
+
...
|
134
|
+
@property
|
135
|
+
def jobset_control_addr(self):
|
136
|
+
...
|
137
|
+
@property
|
138
|
+
def worker(self):
|
139
|
+
...
|
140
|
+
@property
|
141
|
+
def control(self):
|
142
|
+
...
|
143
|
+
def environment_variable_from_selector(self, name, label_value):
|
144
|
+
...
|
145
|
+
def environment_variables_from_selectors(self, env_dict):
|
146
|
+
...
|
147
|
+
def environment_variable(self, name, value):
|
148
|
+
...
|
149
|
+
def label(self, name, value):
|
150
|
+
...
|
151
|
+
def annotation(self, name, value):
|
152
|
+
...
|
153
|
+
def dump(self):
|
154
|
+
...
|
155
|
+
...
|
156
|
+
|
126
157
|
class ArgoClient(object, metaclass=type):
|
127
158
|
def __init__(self, namespace = None):
|
128
159
|
...
|
@@ -176,7 +207,7 @@ class ArgoWorkflowsSchedulingException(metaflow.exception.MetaflowException, met
|
|
176
207
|
...
|
177
208
|
|
178
209
|
class ArgoWorkflows(object, metaclass=type):
|
179
|
-
def __init__(self, name, graph, flow, code_package_sha, code_package_url, production_token, metadata, flow_datastore, environment, event_logger, monitor, tags = None, namespace = None, username = None, max_workers = None, workflow_timeout = None, workflow_priority = None, auto_emit_argo_events = False, notify_on_error = False, notify_on_success = False, notify_slack_webhook_url = None, notify_pager_duty_integration_key = None):
|
210
|
+
def __init__(self, name, graph: metaflow.graph.FlowGraph, flow, code_package_sha, code_package_url, production_token, metadata, flow_datastore, environment, event_logger, monitor, tags = None, namespace = None, username = None, max_workers = None, workflow_timeout = None, workflow_priority = None, auto_emit_argo_events = False, notify_on_error = False, notify_on_success = False, notify_slack_webhook_url = None, notify_pager_duty_integration_key = None):
|
180
211
|
...
|
181
212
|
def __str__(self):
|
182
213
|
...
|
@@ -359,6 +390,8 @@ class Template(object, metaclass=type):
|
|
359
390
|
...
|
360
391
|
def to_json(self):
|
361
392
|
...
|
393
|
+
def resource(self, action, manifest, success_criteria, failure_criteria):
|
394
|
+
...
|
362
395
|
def __str__(self):
|
363
396
|
...
|
364
397
|
...
|
@@ -1,22 +1,281 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-07-
|
3
|
+
# MF version: 2.12.9 #
|
4
|
+
# Generated on 2024-07-25T18:20:16.329989 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import
|
11
|
+
import datetime
|
12
|
+
import metaflow.client.core
|
12
13
|
import metaflow.parameters
|
13
|
-
import metaflow.exception
|
14
14
|
import metaflow.metaflow_current
|
15
|
+
import metaflow.decorators
|
16
|
+
import metaflow.graph
|
17
|
+
import metaflow.events
|
18
|
+
import metaflow.exception
|
19
|
+
|
20
|
+
class Run(metaflow.client.core.MetaflowObject, metaclass=type):
|
21
|
+
def steps(self, *tags: str) -> typing.Iterator[metaflow.client.core.Step]:
|
22
|
+
"""
|
23
|
+
[Legacy function - do not use]
|
24
|
+
|
25
|
+
Returns an iterator over all `Step` objects in the step. This is an alias
|
26
|
+
to iterating the object itself, i.e.
|
27
|
+
```
|
28
|
+
list(Run(...)) == list(Run(...).steps())
|
29
|
+
```
|
30
|
+
|
31
|
+
Parameters
|
32
|
+
----------
|
33
|
+
tags : str
|
34
|
+
No op (legacy functionality)
|
35
|
+
|
36
|
+
Yields
|
37
|
+
------
|
38
|
+
Step
|
39
|
+
`Step` objects in this run.
|
40
|
+
"""
|
41
|
+
...
|
42
|
+
@property
|
43
|
+
def code(self) -> typing.Optional[metaflow.client.core.MetaflowCode]:
|
44
|
+
"""
|
45
|
+
Returns the MetaflowCode object for this run, if present.
|
46
|
+
Code is packed if atleast one `Step` runs remotely, else None is returned.
|
47
|
+
|
48
|
+
Returns
|
49
|
+
-------
|
50
|
+
MetaflowCode, optional
|
51
|
+
Code package for this run
|
52
|
+
"""
|
53
|
+
...
|
54
|
+
@property
|
55
|
+
def data(self) -> typing.Optional[metaflow.client.core.MetaflowData]:
|
56
|
+
"""
|
57
|
+
Returns a container of data artifacts produced by this run.
|
58
|
+
|
59
|
+
You can access data produced by this run as follows:
|
60
|
+
```
|
61
|
+
print(run.data.my_var)
|
62
|
+
```
|
63
|
+
This is a shorthand for `run['end'].task.data`. If the 'end' step has not yet
|
64
|
+
executed, returns None.
|
65
|
+
|
66
|
+
Returns
|
67
|
+
-------
|
68
|
+
MetaflowData, optional
|
69
|
+
Container of all artifacts produced by this task
|
70
|
+
"""
|
71
|
+
...
|
72
|
+
@property
|
73
|
+
def successful(self) -> bool:
|
74
|
+
"""
|
75
|
+
Indicates whether or not the run completed successfully.
|
76
|
+
|
77
|
+
A run is successful if its 'end' step is successful.
|
78
|
+
|
79
|
+
Returns
|
80
|
+
-------
|
81
|
+
bool
|
82
|
+
True if the run completed successfully and False otherwise
|
83
|
+
"""
|
84
|
+
...
|
85
|
+
@property
|
86
|
+
def finished(self) -> bool:
|
87
|
+
"""
|
88
|
+
Indicates whether or not the run completed.
|
89
|
+
|
90
|
+
A run completed if its 'end' step completed.
|
91
|
+
|
92
|
+
Returns
|
93
|
+
-------
|
94
|
+
bool
|
95
|
+
True if the run completed and False otherwise
|
96
|
+
"""
|
97
|
+
...
|
98
|
+
@property
|
99
|
+
def finished_at(self) -> typing.Optional[datetime.datetime]:
|
100
|
+
"""
|
101
|
+
Returns the datetime object of when the run finished (successfully or not).
|
102
|
+
|
103
|
+
The completion time of a run is the same as the completion time of its 'end' step.
|
104
|
+
If the 'end' step has not completed, returns None.
|
105
|
+
|
106
|
+
Returns
|
107
|
+
-------
|
108
|
+
datetime, optional
|
109
|
+
Datetime of when the run finished
|
110
|
+
"""
|
111
|
+
...
|
112
|
+
@property
|
113
|
+
def end_task(self) -> typing.Optional[metaflow.client.core.Task]:
|
114
|
+
"""
|
115
|
+
Returns the Task corresponding to the 'end' step.
|
116
|
+
|
117
|
+
This returns None if the end step does not yet exist.
|
118
|
+
|
119
|
+
Returns
|
120
|
+
-------
|
121
|
+
Task, optional
|
122
|
+
The 'end' task
|
123
|
+
"""
|
124
|
+
...
|
125
|
+
def add_tag(self, tag: str):
|
126
|
+
"""
|
127
|
+
Add a tag to this `Run`.
|
128
|
+
|
129
|
+
Note that if the tag is already a system tag, it is not added as a user tag,
|
130
|
+
and no error is thrown.
|
131
|
+
|
132
|
+
Parameters
|
133
|
+
----------
|
134
|
+
tag : str
|
135
|
+
Tag to add.
|
136
|
+
"""
|
137
|
+
...
|
138
|
+
def add_tags(self, tags: typing.Iterable[str]):
|
139
|
+
"""
|
140
|
+
Add one or more tags to this `Run`.
|
141
|
+
|
142
|
+
Note that if any tag is already a system tag, it is not added as a user tag
|
143
|
+
and no error is thrown.
|
144
|
+
|
145
|
+
Parameters
|
146
|
+
----------
|
147
|
+
tags : Iterable[str]
|
148
|
+
Tags to add.
|
149
|
+
"""
|
150
|
+
...
|
151
|
+
def remove_tag(self, tag: str):
|
152
|
+
"""
|
153
|
+
Remove one tag from this `Run`.
|
154
|
+
|
155
|
+
Removing a system tag is an error. Removing a non-existent
|
156
|
+
user tag is a no-op.
|
157
|
+
|
158
|
+
Parameters
|
159
|
+
----------
|
160
|
+
tag : str
|
161
|
+
Tag to remove.
|
162
|
+
"""
|
163
|
+
...
|
164
|
+
def remove_tags(self, tags: typing.Iterable[str]):
|
165
|
+
"""
|
166
|
+
Remove one or more tags to this `Run`.
|
167
|
+
|
168
|
+
Removing a system tag will result in an error. Removing a non-existent
|
169
|
+
user tag is a no-op.
|
170
|
+
|
171
|
+
Parameters
|
172
|
+
----------
|
173
|
+
tags : Iterable[str]
|
174
|
+
Tags to remove.
|
175
|
+
"""
|
176
|
+
...
|
177
|
+
def replace_tag(self, tag_to_remove: str, tag_to_add: str):
|
178
|
+
"""
|
179
|
+
Remove a tag and add a tag atomically. Removal is done first.
|
180
|
+
The rules for `Run.add_tag` and `Run.remove_tag` also apply here.
|
181
|
+
|
182
|
+
Parameters
|
183
|
+
----------
|
184
|
+
tag_to_remove : str
|
185
|
+
Tag to remove.
|
186
|
+
tag_to_add : str
|
187
|
+
Tag to add.
|
188
|
+
"""
|
189
|
+
...
|
190
|
+
def replace_tags(self, tags_to_remove: typing.Iterable[str], tags_to_add: typing.Iterable[str]):
|
191
|
+
"""
|
192
|
+
Remove and add tags atomically; the removal is done first.
|
193
|
+
The rules for `Run.add_tag` and `Run.remove_tag` also apply here.
|
194
|
+
|
195
|
+
Parameters
|
196
|
+
----------
|
197
|
+
tags_to_remove : Iterable[str]
|
198
|
+
Tags to remove.
|
199
|
+
tags_to_add : Iterable[str]
|
200
|
+
Tags to add.
|
201
|
+
"""
|
202
|
+
...
|
203
|
+
def __iter__(self) -> typing.Iterator[metaflow.client.core.Step]:
|
204
|
+
"""
|
205
|
+
Iterate over all children Step of this Run
|
206
|
+
|
207
|
+
Yields
|
208
|
+
------
|
209
|
+
Step
|
210
|
+
A Step in this Run
|
211
|
+
"""
|
212
|
+
...
|
213
|
+
def __getitem__(self, name: str) -> metaflow.client.core.Step:
|
214
|
+
"""
|
215
|
+
Returns the Step object with the step name 'name'
|
216
|
+
|
217
|
+
Parameters
|
218
|
+
----------
|
219
|
+
name : str
|
220
|
+
Step name
|
221
|
+
|
222
|
+
Returns
|
223
|
+
-------
|
224
|
+
Step
|
225
|
+
Step for this step name in this Run
|
226
|
+
|
227
|
+
Raises
|
228
|
+
------
|
229
|
+
KeyError
|
230
|
+
If the name does not identify a valid Step object
|
231
|
+
"""
|
232
|
+
...
|
233
|
+
def __getstate__(self):
|
234
|
+
...
|
235
|
+
def __setstate__(self, state):
|
236
|
+
...
|
237
|
+
@property
|
238
|
+
def trigger(self) -> typing.Optional[metaflow.events.Trigger]:
|
239
|
+
"""
|
240
|
+
Returns a container of events that triggered this run.
|
241
|
+
|
242
|
+
This returns None if the run was not triggered by any events.
|
243
|
+
|
244
|
+
Returns
|
245
|
+
-------
|
246
|
+
Trigger, optional
|
247
|
+
Container of triggering events
|
248
|
+
"""
|
249
|
+
...
|
250
|
+
...
|
15
251
|
|
16
252
|
JSONType: metaflow.parameters.JSONTypeClass
|
17
253
|
|
18
254
|
current: metaflow.metaflow_current.Current
|
19
255
|
|
256
|
+
def get_metadata() -> str:
|
257
|
+
"""
|
258
|
+
Returns the current Metadata provider.
|
259
|
+
|
260
|
+
If this is not set explicitly using `metadata`, the default value is
|
261
|
+
determined through the Metaflow configuration. You can use this call to
|
262
|
+
check that your configuration is set up properly.
|
263
|
+
|
264
|
+
If multiple configuration profiles are present, this call returns the one
|
265
|
+
selected through the `METAFLOW_PROFILE` environment variable.
|
266
|
+
|
267
|
+
Returns
|
268
|
+
-------
|
269
|
+
str
|
270
|
+
Information about the Metadata provider currently selected. This information typically
|
271
|
+
returns provider specific information (like URL for remote providers or local paths for
|
272
|
+
local providers).
|
273
|
+
"""
|
274
|
+
...
|
275
|
+
|
276
|
+
class MetaflowNotFound(metaflow.exception.MetaflowException, metaclass=type):
|
277
|
+
...
|
278
|
+
|
20
279
|
class MetaflowException(Exception, metaclass=type):
|
21
280
|
def __init__(self, msg = "", lineno = None):
|
22
281
|
...
|
@@ -80,7 +339,7 @@ def validate_tags(tags, existing_tags = None):
|
|
80
339
|
...
|
81
340
|
|
82
341
|
class ArgoWorkflows(object, metaclass=type):
|
83
|
-
def __init__(self, name, graph, flow, code_package_sha, code_package_url, production_token, metadata, flow_datastore, environment, event_logger, monitor, tags = None, namespace = None, username = None, max_workers = None, workflow_timeout = None, workflow_priority = None, auto_emit_argo_events = False, notify_on_error = False, notify_on_success = False, notify_slack_webhook_url = None, notify_pager_duty_integration_key = None):
|
342
|
+
def __init__(self, name, graph: metaflow.graph.FlowGraph, flow, code_package_sha, code_package_url, production_token, metadata, flow_datastore, environment, event_logger, monitor, tags = None, namespace = None, username = None, max_workers = None, workflow_timeout = None, workflow_priority = None, auto_emit_argo_events = False, notify_on_error = False, notify_on_success = False, notify_slack_webhook_url = None, notify_pager_duty_integration_key = None):
|
84
343
|
...
|
85
344
|
def __str__(self):
|
86
345
|
...
|
@@ -159,6 +418,12 @@ def validate_token(name, token_prefix, authorize, instructions_fn = None):
|
|
159
418
|
"""
|
160
419
|
...
|
161
420
|
|
421
|
+
def get_run_object(pathspec: str):
|
422
|
+
...
|
423
|
+
|
424
|
+
def get_status_considering_run_object(status, run_obj):
|
425
|
+
...
|
426
|
+
|
162
427
|
def validate_run_id(workflow_name, token_prefix, authorize, run_id, instructions_fn = None):
|
163
428
|
"""
|
164
429
|
Validates that a run_id adheres to the Argo Workflows naming rules, and
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-07-
|
3
|
+
# MF version: 2.12.9 #
|
4
|
+
# Generated on 2024-07-25T18:20:16.319363 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -9,8 +9,12 @@ from __future__ import annotations
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
11
|
import metaflow
|
12
|
+
import metaflow.flowspec
|
13
|
+
import typing
|
12
14
|
import metaflow.metaflow_current
|
15
|
+
import metaflow.datastore.inputs
|
13
16
|
import metaflow.decorators
|
17
|
+
import metaflow.graph
|
14
18
|
import metaflow.events
|
15
19
|
|
16
20
|
current: metaflow.metaflow_current.Current
|
@@ -109,6 +113,227 @@ class MetaDatum(tuple, metaclass=type):
|
|
109
113
|
|
110
114
|
ARGO_EVENTS_WEBHOOK_URL: None
|
111
115
|
|
116
|
+
class FlowSpec(object, metaclass=metaflow.flowspec._FlowSpecMeta):
|
117
|
+
def __init__(self, use_cli = True):
|
118
|
+
"""
|
119
|
+
Construct a FlowSpec
|
120
|
+
|
121
|
+
Parameters
|
122
|
+
----------
|
123
|
+
use_cli : bool, default True
|
124
|
+
Set to True if the flow is invoked from __main__ or the command line
|
125
|
+
"""
|
126
|
+
...
|
127
|
+
@property
|
128
|
+
def script_name(self) -> str:
|
129
|
+
"""
|
130
|
+
[Legacy function - do not use. Use `current` instead]
|
131
|
+
|
132
|
+
Returns the name of the script containing the flow
|
133
|
+
|
134
|
+
Returns
|
135
|
+
-------
|
136
|
+
str
|
137
|
+
A string containing the name of the script
|
138
|
+
"""
|
139
|
+
...
|
140
|
+
def __iter__(self):
|
141
|
+
"""
|
142
|
+
[Legacy function - do not use]
|
143
|
+
|
144
|
+
Iterate over all steps in the Flow
|
145
|
+
|
146
|
+
Returns
|
147
|
+
-------
|
148
|
+
Iterator[graph.DAGNode]
|
149
|
+
Iterator over the steps in the flow
|
150
|
+
"""
|
151
|
+
...
|
152
|
+
def __getattr__(self, name: str):
|
153
|
+
...
|
154
|
+
def cmd(self, cmdline, input = {}, output = []):
|
155
|
+
"""
|
156
|
+
[Legacy function - do not use]
|
157
|
+
"""
|
158
|
+
...
|
159
|
+
@property
|
160
|
+
def index(self) -> typing.Optional[int]:
|
161
|
+
"""
|
162
|
+
The index of this foreach branch.
|
163
|
+
|
164
|
+
In a foreach step, multiple instances of this step (tasks) will be executed,
|
165
|
+
one for each element in the foreach. This property returns the zero based index
|
166
|
+
of the current task. If this is not a foreach step, this returns None.
|
167
|
+
|
168
|
+
If you need to know the indices of the parent tasks in a nested foreach, use
|
169
|
+
`FlowSpec.foreach_stack`.
|
170
|
+
|
171
|
+
Returns
|
172
|
+
-------
|
173
|
+
int, optional
|
174
|
+
Index of the task in a foreach step.
|
175
|
+
"""
|
176
|
+
...
|
177
|
+
@property
|
178
|
+
def input(self) -> typing.Optional[typing.Any]:
|
179
|
+
"""
|
180
|
+
The value of the foreach artifact in this foreach branch.
|
181
|
+
|
182
|
+
In a foreach step, multiple instances of this step (tasks) will be executed,
|
183
|
+
one for each element in the foreach. This property returns the element passed
|
184
|
+
to the current task. If this is not a foreach step, this returns None.
|
185
|
+
|
186
|
+
If you need to know the values of the parent tasks in a nested foreach, use
|
187
|
+
`FlowSpec.foreach_stack`.
|
188
|
+
|
189
|
+
Returns
|
190
|
+
-------
|
191
|
+
object, optional
|
192
|
+
Input passed to the foreach task.
|
193
|
+
"""
|
194
|
+
...
|
195
|
+
def foreach_stack(self) -> typing.Optional[typing.List[typing.Tuple[int, int, typing.Any]]]:
|
196
|
+
"""
|
197
|
+
Returns the current stack of foreach indexes and values for the current step.
|
198
|
+
|
199
|
+
Use this information to understand what data is being processed in the current
|
200
|
+
foreach branch. For example, considering the following code:
|
201
|
+
```
|
202
|
+
@step
|
203
|
+
def root(self):
|
204
|
+
self.split_1 = ['a', 'b', 'c']
|
205
|
+
self.next(self.nest_1, foreach='split_1')
|
206
|
+
|
207
|
+
@step
|
208
|
+
def nest_1(self):
|
209
|
+
self.split_2 = ['d', 'e', 'f', 'g']
|
210
|
+
self.next(self.nest_2, foreach='split_2'):
|
211
|
+
|
212
|
+
@step
|
213
|
+
def nest_2(self):
|
214
|
+
foo = self.foreach_stack()
|
215
|
+
```
|
216
|
+
|
217
|
+
`foo` will take the following values in the various tasks for nest_2:
|
218
|
+
```
|
219
|
+
[(0, 3, 'a'), (0, 4, 'd')]
|
220
|
+
[(0, 3, 'a'), (1, 4, 'e')]
|
221
|
+
...
|
222
|
+
[(0, 3, 'a'), (3, 4, 'g')]
|
223
|
+
[(1, 3, 'b'), (0, 4, 'd')]
|
224
|
+
...
|
225
|
+
```
|
226
|
+
where each tuple corresponds to:
|
227
|
+
|
228
|
+
- The index of the task for that level of the loop.
|
229
|
+
- The number of splits for that level of the loop.
|
230
|
+
- The value for that level of the loop.
|
231
|
+
|
232
|
+
Note that the last tuple returned in a task corresponds to:
|
233
|
+
|
234
|
+
- 1st element: value returned by `self.index`.
|
235
|
+
- 3rd element: value returned by `self.input`.
|
236
|
+
|
237
|
+
Returns
|
238
|
+
-------
|
239
|
+
List[Tuple[int, int, Any]]
|
240
|
+
An array describing the current stack of foreach steps.
|
241
|
+
"""
|
242
|
+
...
|
243
|
+
def merge_artifacts(self, inputs: metaflow.datastore.inputs.Inputs, exclude: typing.Optional[typing.List[str]] = None, include: typing.Optional[typing.List[str]] = None):
|
244
|
+
"""
|
245
|
+
Helper function for merging artifacts in a join step.
|
246
|
+
|
247
|
+
This function takes all the artifacts coming from the branches of a
|
248
|
+
join point and assigns them to self in the calling step. Only artifacts
|
249
|
+
not set in the current step are considered. If, for a given artifact, different
|
250
|
+
values are present on the incoming edges, an error will be thrown and the artifacts
|
251
|
+
that conflict will be reported.
|
252
|
+
|
253
|
+
As a few examples, in the simple graph: A splitting into B and C and joining in D:
|
254
|
+
```
|
255
|
+
A:
|
256
|
+
self.x = 5
|
257
|
+
self.y = 6
|
258
|
+
B:
|
259
|
+
self.b_var = 1
|
260
|
+
self.x = from_b
|
261
|
+
C:
|
262
|
+
self.x = from_c
|
263
|
+
|
264
|
+
D:
|
265
|
+
merge_artifacts(inputs)
|
266
|
+
```
|
267
|
+
In D, the following artifacts are set:
|
268
|
+
- `y` (value: 6), `b_var` (value: 1)
|
269
|
+
- if `from_b` and `from_c` are the same, `x` will be accessible and have value `from_b`
|
270
|
+
- if `from_b` and `from_c` are different, an error will be thrown. To prevent this error,
|
271
|
+
you need to manually set `self.x` in D to a merged value (for example the max) prior to
|
272
|
+
calling `merge_artifacts`.
|
273
|
+
|
274
|
+
Parameters
|
275
|
+
----------
|
276
|
+
inputs : Inputs
|
277
|
+
Incoming steps to the join point.
|
278
|
+
exclude : List[str], optional, default None
|
279
|
+
If specified, do not consider merging artifacts with a name in `exclude`.
|
280
|
+
Cannot specify if `include` is also specified.
|
281
|
+
include : List[str], optional, default None
|
282
|
+
If specified, only merge artifacts specified. Cannot specify if `exclude` is
|
283
|
+
also specified.
|
284
|
+
|
285
|
+
Raises
|
286
|
+
------
|
287
|
+
MetaflowException
|
288
|
+
This exception is thrown if this is not called in a join step.
|
289
|
+
UnhandledInMergeArtifactsException
|
290
|
+
This exception is thrown in case of unresolved conflicts.
|
291
|
+
MissingInMergeArtifactsException
|
292
|
+
This exception is thrown in case an artifact specified in `include` cannot
|
293
|
+
be found.
|
294
|
+
"""
|
295
|
+
...
|
296
|
+
def next(self, *dsts: typing.Callable[..., None], **kwargs):
|
297
|
+
"""
|
298
|
+
Indicates the next step to execute after this step has completed.
|
299
|
+
|
300
|
+
This statement should appear as the last statement of each step, except
|
301
|
+
the end step.
|
302
|
+
|
303
|
+
There are several valid formats to specify the next step:
|
304
|
+
|
305
|
+
- Straight-line connection: `self.next(self.next_step)` where `next_step` is a method in
|
306
|
+
the current class decorated with the `@step` decorator.
|
307
|
+
|
308
|
+
- Static fan-out connection: `self.next(self.step1, self.step2, ...)` where `stepX` are
|
309
|
+
methods in the current class decorated with the `@step` decorator.
|
310
|
+
|
311
|
+
- Foreach branch:
|
312
|
+
```
|
313
|
+
self.next(self.foreach_step, foreach='foreach_iterator')
|
314
|
+
```
|
315
|
+
In this situation, `foreach_step` is a method in the current class decorated with the
|
316
|
+
`@step` decorator and `foreach_iterator` is a variable name in the current class that
|
317
|
+
evaluates to an iterator. A task will be launched for each value in the iterator and
|
318
|
+
each task will execute the code specified by the step `foreach_step`.
|
319
|
+
|
320
|
+
Parameters
|
321
|
+
----------
|
322
|
+
dsts : Callable[..., None]
|
323
|
+
One or more methods annotated with `@step`.
|
324
|
+
|
325
|
+
Raises
|
326
|
+
------
|
327
|
+
InvalidNextException
|
328
|
+
Raised if the format of the arguments does not match one of the ones given above.
|
329
|
+
"""
|
330
|
+
...
|
331
|
+
def __str__(self):
|
332
|
+
...
|
333
|
+
def __getstate__(self):
|
334
|
+
...
|
335
|
+
...
|
336
|
+
|
112
337
|
class ArgoEvent(object, metaclass=type):
|
113
338
|
def __init__(self, name, url = None, payload = None, access_token = None):
|
114
339
|
...
|
@@ -163,7 +388,7 @@ class ArgoEvent(object, metaclass=type):
|
|
163
388
|
class ArgoWorkflowsInternalDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
164
389
|
def task_pre_step(self, step_name, task_datastore, metadata, run_id, task_id, flow, graph, retry_count, max_user_code_retries, ubf_context, inputs):
|
165
390
|
...
|
166
|
-
def task_finished(self, step_name, flow, graph, is_task_ok, retry_count, max_user_code_retries):
|
391
|
+
def task_finished(self, step_name, flow: metaflow.flowspec.FlowSpec, graph: metaflow.graph.FlowGraph, is_task_ok, retry_count, max_user_code_retries):
|
167
392
|
...
|
168
393
|
...
|
169
394
|
|