ob-metaflow-stubs 6.0.3.117__py2.py3-none-any.whl → 6.0.3.119__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- metaflow-stubs/__init__.pyi +318 -2738
- metaflow-stubs/cards.pyi +19 -473
- metaflow-stubs/cli.pyi +17 -81
- metaflow-stubs/client/__init__.pyi +19 -1113
- metaflow-stubs/client/core.pyi +18 -158
- metaflow-stubs/client/filecache.pyi +8 -12
- metaflow-stubs/clone_util.pyi +6 -26
- metaflow-stubs/events.pyi +7 -6
- metaflow-stubs/exception.pyi +8 -6
- metaflow-stubs/flowspec.pyi +20 -104
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +16 -564
- metaflow-stubs/info_file.pyi +6 -5
- metaflow-stubs/metadata_provider/__init__.pyi +16 -0
- metaflow-stubs/metadata_provider/heartbeat.pyi +34 -0
- metaflow-stubs/{metadata → metadata_provider}/metadata.pyi +10 -22
- metaflow-stubs/metadata_provider/util.pyi +19 -0
- metaflow-stubs/metaflow_config.pyi +8 -13
- metaflow-stubs/metaflow_current.pyi +45 -44
- metaflow-stubs/mf_extensions/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +129 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +26 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +156 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +25 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +111 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +188 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +30 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +28 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +19 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +115 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +40 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +71 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +56 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +67 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +49 -0
- metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +130 -0
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +42 -0
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +17 -0
- metaflow-stubs/mflog/__init__.pyi +6 -0
- metaflow-stubs/mflog/mflog.pyi +52 -5
- metaflow-stubs/multicore_utils.pyi +6 -5
- metaflow-stubs/parameters.pyi +13 -23
- metaflow-stubs/plugins/__init__.pyi +52 -165
- metaflow-stubs/plugins/airflow/__init__.pyi +9 -5
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +7 -6
- metaflow-stubs/plugins/airflow/exception.pyi +7 -11
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +10 -97
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +9 -30
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +9 -40
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +9 -40
- metaflow-stubs/plugins/argo/__init__.pyi +12 -5
- metaflow-stubs/plugins/argo/argo_client.pyi +8 -26
- metaflow-stubs/plugins/argo/argo_events.pyi +7 -11
- metaflow-stubs/plugins/argo/argo_workflows.pyi +17 -129
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +22 -460
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +11 -403
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +63 -448
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +165 -0
- metaflow-stubs/plugins/aws/__init__.pyi +11 -5
- metaflow-stubs/plugins/aws/aws_client.pyi +6 -5
- metaflow-stubs/plugins/aws/aws_utils.pyi +6 -11
- metaflow-stubs/plugins/aws/batch/__init__.pyi +9 -5
- metaflow-stubs/plugins/aws/batch/batch.pyi +10 -55
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +7 -11
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +15 -140
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +7 -5
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +10 -21
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +9 -5
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +6 -5
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +6 -5
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +7 -5
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +11 -65
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +6 -5
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +52 -292
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +127 -0
- metaflow-stubs/plugins/azure/__init__.pyi +12 -7
- metaflow-stubs/plugins/azure/azure_credential.pyi +6 -5
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +7 -11
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +11 -24
- metaflow-stubs/plugins/azure/azure_utils.pyi +11 -29
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +8 -23
- metaflow-stubs/plugins/azure/includefile_support.pyi +7 -17
- metaflow-stubs/plugins/cards/__init__.pyi +15 -5
- metaflow-stubs/plugins/cards/card_cli.pyi +22 -491
- metaflow-stubs/plugins/cards/card_client.pyi +14 -76
- metaflow-stubs/plugins/cards/card_creator.pyi +7 -10
- metaflow-stubs/plugins/cards/card_datastore.pyi +10 -18
- metaflow-stubs/plugins/cards/card_decorator.pyi +10 -126
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +13 -81
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +13 -96
- metaflow-stubs/plugins/cards/card_modules/card.pyi +6 -5
- metaflow-stubs/plugins/cards/card_modules/components.pyi +24 -107
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +6 -5
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +6 -12
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +11 -88
- metaflow-stubs/plugins/cards/card_resolver.pyi +6 -49
- metaflow-stubs/plugins/cards/component_serializer.pyi +13 -63
- metaflow-stubs/plugins/cards/exception.pyi +7 -11
- metaflow-stubs/plugins/catch_decorator.pyi +10 -30
- metaflow-stubs/plugins/datatools/__init__.pyi +13 -392
- metaflow-stubs/plugins/datatools/local.pyi +7 -11
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +19 -653
- metaflow-stubs/plugins/datatools/s3/s3.pyi +15 -263
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +7 -10
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +6 -11
- metaflow-stubs/plugins/debug_logger.pyi +7 -5
- metaflow-stubs/plugins/debug_monitor.pyi +7 -5
- metaflow-stubs/plugins/environment_decorator.pyi +7 -5
- metaflow-stubs/plugins/events_decorator.pyi +8 -14
- metaflow-stubs/plugins/frameworks/__init__.pyi +7 -5
- metaflow-stubs/plugins/frameworks/pytorch.pyi +8 -45
- metaflow-stubs/plugins/gcp/__init__.pyi +11 -7
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +11 -24
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +7 -11
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +6 -5
- metaflow-stubs/plugins/gcp/gs_utils.pyi +8 -20
- metaflow-stubs/plugins/gcp/includefile_support.pyi +7 -17
- metaflow-stubs/plugins/kubernetes/__init__.pyi +12 -5
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +6 -10
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +10 -38
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +16 -155
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +7 -11
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +19 -142
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +7 -11
- metaflow-stubs/plugins/logs_cli.pyi +10 -9
- metaflow-stubs/plugins/package_cli.pyi +7 -5
- metaflow-stubs/plugins/parallel_decorator.pyi +11 -59
- metaflow-stubs/plugins/perimeters.pyi +6 -11
- metaflow-stubs/plugins/project_decorator.pyi +8 -14
- metaflow-stubs/plugins/pypi/__init__.pyi +12 -11
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +8 -27
- metaflow-stubs/plugins/pypi/conda_environment.pyi +14 -20
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +7 -5
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +7 -39
- metaflow-stubs/plugins/pypi/utils.pyi +7 -11
- metaflow-stubs/plugins/resources_decorator.pyi +7 -5
- metaflow-stubs/plugins/retry_decorator.pyi +7 -11
- metaflow-stubs/plugins/secrets/__init__.pyi +9 -5
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +8 -13
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +7 -11
- metaflow-stubs/plugins/storage_executor.pyi +6 -11
- metaflow-stubs/plugins/tag_cli.pyi +14 -396
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +9 -34
- metaflow-stubs/plugins/timeout_decorator.pyi +8 -12
- metaflow-stubs/procpoll.pyi +7 -5
- metaflow-stubs/profilers/__init__.pyi +7 -11
- metaflow-stubs/pylint_wrapper.pyi +7 -11
- metaflow-stubs/runner/__init__.pyi +13 -5
- metaflow-stubs/runner/deployer.pyi +99 -223
- metaflow-stubs/runner/deployer_impl.pyi +87 -0
- metaflow-stubs/runner/metaflow_runner.pyi +24 -508
- metaflow-stubs/runner/nbdeploy.pyi +16 -60
- metaflow-stubs/runner/nbrun.pyi +11 -148
- metaflow-stubs/runner/subprocess_manager.pyi +9 -10
- metaflow-stubs/runner/utils.pyi +44 -9
- metaflow-stubs/system/__init__.pyi +9 -107
- metaflow-stubs/system/system_logger.pyi +7 -16
- metaflow-stubs/system/system_monitor.pyi +6 -16
- metaflow-stubs/tagging_util.pyi +6 -10
- metaflow-stubs/tuple_util.pyi +6 -5
- {ob_metaflow_stubs-6.0.3.117.dist-info → ob_metaflow_stubs-6.0.3.119.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.119.dist-info/RECORD +174 -0
- metaflow-stubs/metadata/util.pyi +0 -18
- ob_metaflow_stubs-6.0.3.117.dist-info/RECORD +0 -140
- {ob_metaflow_stubs-6.0.3.117.dist-info → ob_metaflow_stubs-6.0.3.119.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.117.dist-info → ob_metaflow_stubs-6.0.3.119.dist-info}/top_level.txt +0 -0
@@ -1,418 +1,26 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-11-
|
5
|
-
|
1
|
+
######################################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.12.30.2+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-11-21T22:12:20.853136 #
|
5
|
+
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
|
+
import metaflow
|
9
10
|
import typing
|
10
11
|
if typing.TYPE_CHECKING:
|
11
12
|
import metaflow.flowspec
|
12
13
|
import metaflow.graph
|
13
|
-
import metaflow
|
14
14
|
import metaflow.decorators
|
15
|
-
import metaflow.events
|
16
|
-
import metaflow.metaflow_current
|
17
|
-
import metaflow.datastore.inputs
|
18
|
-
import typing
|
19
15
|
|
20
|
-
current
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
"""
|
26
|
-
def __init__(self, _meta = None):
|
27
|
-
...
|
28
|
-
@classmethod
|
29
|
-
def from_runs(cls, run_objs: typing.List["metaflow.Run"]):
|
30
|
-
...
|
31
|
-
@property
|
32
|
-
def event(self) -> typing.Optional[metaflow.events.MetaflowEvent]:
|
33
|
-
"""
|
34
|
-
The `MetaflowEvent` object corresponding to the triggering event.
|
35
|
-
|
36
|
-
If multiple events triggered the run, this property is the latest event.
|
37
|
-
|
38
|
-
Returns
|
39
|
-
-------
|
40
|
-
MetaflowEvent, optional
|
41
|
-
The latest event that triggered the run, if applicable.
|
42
|
-
"""
|
43
|
-
...
|
44
|
-
@property
|
45
|
-
def events(self) -> typing.Optional[typing.List[metaflow.events.MetaflowEvent]]:
|
46
|
-
"""
|
47
|
-
The list of `MetaflowEvent` objects correspondings to all the triggering events.
|
48
|
-
|
49
|
-
Returns
|
50
|
-
-------
|
51
|
-
List[MetaflowEvent], optional
|
52
|
-
List of all events that triggered the run
|
53
|
-
"""
|
54
|
-
...
|
55
|
-
@property
|
56
|
-
def run(self) -> typing.Optional["metaflow.Run"]:
|
57
|
-
"""
|
58
|
-
The corresponding `Run` object if the triggering event is a Metaflow run.
|
59
|
-
|
60
|
-
In case multiple runs triggered the run, this property is the latest run.
|
61
|
-
Returns `None` if none of the triggering events are a `Run`.
|
62
|
-
|
63
|
-
Returns
|
64
|
-
-------
|
65
|
-
Run, optional
|
66
|
-
Latest Run that triggered this run, if applicable.
|
67
|
-
"""
|
68
|
-
...
|
69
|
-
@property
|
70
|
-
def runs(self) -> typing.Optional[typing.List["metaflow.Run"]]:
|
71
|
-
"""
|
72
|
-
The list of `Run` objects in the triggering events.
|
73
|
-
Returns `None` if none of the triggering events are `Run` objects.
|
74
|
-
|
75
|
-
Returns
|
76
|
-
-------
|
77
|
-
List[Run], optional
|
78
|
-
List of runs that triggered this run, if applicable.
|
79
|
-
"""
|
80
|
-
...
|
81
|
-
def __getitem__(self, key: str) -> typing.Union["metaflow.Run", metaflow.events.MetaflowEvent]:
|
82
|
-
"""
|
83
|
-
If triggering events are runs, `key` corresponds to the flow name of the triggering run.
|
84
|
-
Otherwise, `key` corresponds to the event name and a `MetaflowEvent` object is returned.
|
85
|
-
|
86
|
-
Returns
|
87
|
-
-------
|
88
|
-
Union[Run, MetaflowEvent]
|
89
|
-
`Run` object if triggered by a run. Otherwise returns a `MetaflowEvent`.
|
90
|
-
"""
|
91
|
-
...
|
92
|
-
def __iter__(self):
|
93
|
-
...
|
94
|
-
def __contains__(self, ident: str) -> bool:
|
95
|
-
...
|
96
|
-
...
|
97
|
-
|
98
|
-
class MetaDatum(tuple, metaclass=type):
|
99
|
-
"""
|
100
|
-
MetaDatum(field, value, type, tags)
|
101
|
-
"""
|
102
|
-
@staticmethod
|
103
|
-
def __new__(_cls, field, value, type, tags):
|
104
|
-
"""
|
105
|
-
Create new instance of MetaDatum(field, value, type, tags)
|
106
|
-
"""
|
107
|
-
...
|
108
|
-
def __repr__(self):
|
109
|
-
"""
|
110
|
-
Return a nicely formatted representation string
|
111
|
-
"""
|
112
|
-
...
|
113
|
-
def __getnewargs__(self):
|
114
|
-
"""
|
115
|
-
Return self as a plain tuple. Used by copy and pickle.
|
116
|
-
"""
|
117
|
-
...
|
118
|
-
...
|
16
|
+
from ...metaflow_current import current as current
|
17
|
+
from ...events import Trigger as Trigger
|
18
|
+
from ...metadata_provider.metadata import MetaDatum as MetaDatum
|
19
|
+
from ...flowspec import FlowSpec as FlowSpec
|
20
|
+
from .argo_events import ArgoEvent as ArgoEvent
|
119
21
|
|
120
22
|
ARGO_EVENTS_WEBHOOK_URL: None
|
121
23
|
|
122
|
-
class FlowSpec(object, metaclass=metaflow.flowspec._FlowSpecMeta):
|
123
|
-
"""
|
124
|
-
Main class from which all Flows should inherit.
|
125
|
-
|
126
|
-
Attributes
|
127
|
-
----------
|
128
|
-
index
|
129
|
-
input
|
130
|
-
"""
|
131
|
-
def __init__(self, use_cli = True):
|
132
|
-
"""
|
133
|
-
Construct a FlowSpec
|
134
|
-
|
135
|
-
Parameters
|
136
|
-
----------
|
137
|
-
use_cli : bool, default True
|
138
|
-
Set to True if the flow is invoked from __main__ or the command line
|
139
|
-
"""
|
140
|
-
...
|
141
|
-
@property
|
142
|
-
def script_name(self) -> str:
|
143
|
-
"""
|
144
|
-
[Legacy function - do not use. Use `current` instead]
|
145
|
-
|
146
|
-
Returns the name of the script containing the flow
|
147
|
-
|
148
|
-
Returns
|
149
|
-
-------
|
150
|
-
str
|
151
|
-
A string containing the name of the script
|
152
|
-
"""
|
153
|
-
...
|
154
|
-
def __iter__(self):
|
155
|
-
"""
|
156
|
-
[Legacy function - do not use]
|
157
|
-
|
158
|
-
Iterate over all steps in the Flow
|
159
|
-
|
160
|
-
Returns
|
161
|
-
-------
|
162
|
-
Iterator[graph.DAGNode]
|
163
|
-
Iterator over the steps in the flow
|
164
|
-
"""
|
165
|
-
...
|
166
|
-
def __getattr__(self, name: str):
|
167
|
-
...
|
168
|
-
def cmd(self, cmdline, input = {}, output = []):
|
169
|
-
"""
|
170
|
-
[Legacy function - do not use]
|
171
|
-
"""
|
172
|
-
...
|
173
|
-
@property
|
174
|
-
def index(self) -> typing.Optional[int]:
|
175
|
-
"""
|
176
|
-
The index of this foreach branch.
|
177
|
-
|
178
|
-
In a foreach step, multiple instances of this step (tasks) will be executed,
|
179
|
-
one for each element in the foreach. This property returns the zero based index
|
180
|
-
of the current task. If this is not a foreach step, this returns None.
|
181
|
-
|
182
|
-
If you need to know the indices of the parent tasks in a nested foreach, use
|
183
|
-
`FlowSpec.foreach_stack`.
|
184
|
-
|
185
|
-
Returns
|
186
|
-
-------
|
187
|
-
int, optional
|
188
|
-
Index of the task in a foreach step.
|
189
|
-
"""
|
190
|
-
...
|
191
|
-
@property
|
192
|
-
def input(self) -> typing.Optional[typing.Any]:
|
193
|
-
"""
|
194
|
-
The value of the foreach artifact in this foreach branch.
|
195
|
-
|
196
|
-
In a foreach step, multiple instances of this step (tasks) will be executed,
|
197
|
-
one for each element in the foreach. This property returns the element passed
|
198
|
-
to the current task. If this is not a foreach step, this returns None.
|
199
|
-
|
200
|
-
If you need to know the values of the parent tasks in a nested foreach, use
|
201
|
-
`FlowSpec.foreach_stack`.
|
202
|
-
|
203
|
-
Returns
|
204
|
-
-------
|
205
|
-
object, optional
|
206
|
-
Input passed to the foreach task.
|
207
|
-
"""
|
208
|
-
...
|
209
|
-
def foreach_stack(self) -> typing.Optional[typing.List[typing.Tuple[int, int, typing.Any]]]:
|
210
|
-
"""
|
211
|
-
Returns the current stack of foreach indexes and values for the current step.
|
212
|
-
|
213
|
-
Use this information to understand what data is being processed in the current
|
214
|
-
foreach branch. For example, considering the following code:
|
215
|
-
```
|
216
|
-
@step
|
217
|
-
def root(self):
|
218
|
-
self.split_1 = ['a', 'b', 'c']
|
219
|
-
self.next(self.nest_1, foreach='split_1')
|
220
|
-
|
221
|
-
@step
|
222
|
-
def nest_1(self):
|
223
|
-
self.split_2 = ['d', 'e', 'f', 'g']
|
224
|
-
self.next(self.nest_2, foreach='split_2'):
|
225
|
-
|
226
|
-
@step
|
227
|
-
def nest_2(self):
|
228
|
-
foo = self.foreach_stack()
|
229
|
-
```
|
230
|
-
|
231
|
-
`foo` will take the following values in the various tasks for nest_2:
|
232
|
-
```
|
233
|
-
[(0, 3, 'a'), (0, 4, 'd')]
|
234
|
-
[(0, 3, 'a'), (1, 4, 'e')]
|
235
|
-
...
|
236
|
-
[(0, 3, 'a'), (3, 4, 'g')]
|
237
|
-
[(1, 3, 'b'), (0, 4, 'd')]
|
238
|
-
...
|
239
|
-
```
|
240
|
-
where each tuple corresponds to:
|
241
|
-
|
242
|
-
- The index of the task for that level of the loop.
|
243
|
-
- The number of splits for that level of the loop.
|
244
|
-
- The value for that level of the loop.
|
245
|
-
|
246
|
-
Note that the last tuple returned in a task corresponds to:
|
247
|
-
|
248
|
-
- 1st element: value returned by `self.index`.
|
249
|
-
- 3rd element: value returned by `self.input`.
|
250
|
-
|
251
|
-
Returns
|
252
|
-
-------
|
253
|
-
List[Tuple[int, int, Any]]
|
254
|
-
An array describing the current stack of foreach steps.
|
255
|
-
"""
|
256
|
-
...
|
257
|
-
def merge_artifacts(self, inputs: metaflow.datastore.inputs.Inputs, exclude: typing.Optional[typing.List[str]] = None, include: typing.Optional[typing.List[str]] = None):
|
258
|
-
"""
|
259
|
-
Helper function for merging artifacts in a join step.
|
260
|
-
|
261
|
-
This function takes all the artifacts coming from the branches of a
|
262
|
-
join point and assigns them to self in the calling step. Only artifacts
|
263
|
-
not set in the current step are considered. If, for a given artifact, different
|
264
|
-
values are present on the incoming edges, an error will be thrown and the artifacts
|
265
|
-
that conflict will be reported.
|
266
|
-
|
267
|
-
As a few examples, in the simple graph: A splitting into B and C and joining in D:
|
268
|
-
```
|
269
|
-
A:
|
270
|
-
self.x = 5
|
271
|
-
self.y = 6
|
272
|
-
B:
|
273
|
-
self.b_var = 1
|
274
|
-
self.x = from_b
|
275
|
-
C:
|
276
|
-
self.x = from_c
|
277
|
-
|
278
|
-
D:
|
279
|
-
merge_artifacts(inputs)
|
280
|
-
```
|
281
|
-
In D, the following artifacts are set:
|
282
|
-
- `y` (value: 6), `b_var` (value: 1)
|
283
|
-
- if `from_b` and `from_c` are the same, `x` will be accessible and have value `from_b`
|
284
|
-
- if `from_b` and `from_c` are different, an error will be thrown. To prevent this error,
|
285
|
-
you need to manually set `self.x` in D to a merged value (for example the max) prior to
|
286
|
-
calling `merge_artifacts`.
|
287
|
-
|
288
|
-
Parameters
|
289
|
-
----------
|
290
|
-
inputs : Inputs
|
291
|
-
Incoming steps to the join point.
|
292
|
-
exclude : List[str], optional, default None
|
293
|
-
If specified, do not consider merging artifacts with a name in `exclude`.
|
294
|
-
Cannot specify if `include` is also specified.
|
295
|
-
include : List[str], optional, default None
|
296
|
-
If specified, only merge artifacts specified. Cannot specify if `exclude` is
|
297
|
-
also specified.
|
298
|
-
|
299
|
-
Raises
|
300
|
-
------
|
301
|
-
MetaflowException
|
302
|
-
This exception is thrown if this is not called in a join step.
|
303
|
-
UnhandledInMergeArtifactsException
|
304
|
-
This exception is thrown in case of unresolved conflicts.
|
305
|
-
MissingInMergeArtifactsException
|
306
|
-
This exception is thrown in case an artifact specified in `include` cannot
|
307
|
-
be found.
|
308
|
-
"""
|
309
|
-
...
|
310
|
-
def next(self, *dsts: typing.Callable[..., None], **kwargs):
|
311
|
-
"""
|
312
|
-
Indicates the next step to execute after this step has completed.
|
313
|
-
|
314
|
-
This statement should appear as the last statement of each step, except
|
315
|
-
the end step.
|
316
|
-
|
317
|
-
There are several valid formats to specify the next step:
|
318
|
-
|
319
|
-
- Straight-line connection: `self.next(self.next_step)` where `next_step` is a method in
|
320
|
-
the current class decorated with the `@step` decorator.
|
321
|
-
|
322
|
-
- Static fan-out connection: `self.next(self.step1, self.step2, ...)` where `stepX` are
|
323
|
-
methods in the current class decorated with the `@step` decorator.
|
324
|
-
|
325
|
-
- Foreach branch:
|
326
|
-
```
|
327
|
-
self.next(self.foreach_step, foreach='foreach_iterator')
|
328
|
-
```
|
329
|
-
In this situation, `foreach_step` is a method in the current class decorated with the
|
330
|
-
`@step` decorator and `foreach_iterator` is a variable name in the current class that
|
331
|
-
evaluates to an iterator. A task will be launched for each value in the iterator and
|
332
|
-
each task will execute the code specified by the step `foreach_step`.
|
333
|
-
|
334
|
-
Parameters
|
335
|
-
----------
|
336
|
-
dsts : Callable[..., None]
|
337
|
-
One or more methods annotated with `@step`.
|
338
|
-
|
339
|
-
Raises
|
340
|
-
------
|
341
|
-
InvalidNextException
|
342
|
-
Raised if the format of the arguments does not match one of the ones given above.
|
343
|
-
"""
|
344
|
-
...
|
345
|
-
def __str__(self):
|
346
|
-
...
|
347
|
-
def __getstate__(self):
|
348
|
-
...
|
349
|
-
...
|
350
|
-
|
351
|
-
class ArgoEvent(object, metaclass=type):
|
352
|
-
"""
|
353
|
-
ArgoEvent is a small event, a message, that can be published to Argo Workflows. The
|
354
|
-
event will eventually start all flows which have been previously deployed with `@trigger`
|
355
|
-
to wait for this particular named event.
|
356
|
-
|
357
|
-
Parameters
|
358
|
-
----------
|
359
|
-
name : str,
|
360
|
-
Name of the event
|
361
|
-
url : str, optional
|
362
|
-
Override the event endpoint from `ARGO_EVENTS_WEBHOOK_URL`.
|
363
|
-
payload : Dict, optional
|
364
|
-
A set of key-value pairs delivered in this event. Used to set parameters of triggered flows.
|
365
|
-
"""
|
366
|
-
def __init__(self, name, url = None, payload = None, access_token = None):
|
367
|
-
...
|
368
|
-
def add_to_payload(self, key, value):
|
369
|
-
"""
|
370
|
-
Add a key-value pair in the payload. This is typically used to set parameters
|
371
|
-
of triggered flows. Often, `key` is the parameter name you want to set to
|
372
|
-
`value`. Overrides any existing value of `key`.
|
373
|
-
|
374
|
-
Parameters
|
375
|
-
----------
|
376
|
-
key : str
|
377
|
-
Key
|
378
|
-
value : str
|
379
|
-
Value
|
380
|
-
"""
|
381
|
-
...
|
382
|
-
def safe_publish(self, payload = None, ignore_errors = True):
|
383
|
-
"""
|
384
|
-
Publishes an event when called inside a deployed workflow. Outside a deployed workflow
|
385
|
-
this function does nothing.
|
386
|
-
|
387
|
-
Use this function inside flows to create events safely. As this function is a no-op
|
388
|
-
for local runs, you can safely call it during local development without causing unintended
|
389
|
-
side-effects. It takes effect only when deployed on Argo Workflows.
|
390
|
-
|
391
|
-
Parameters
|
392
|
-
----------
|
393
|
-
payload : dict
|
394
|
-
Additional key-value pairs to add to the payload.
|
395
|
-
ignore_errors : bool, default True
|
396
|
-
If True, events are created on a best effort basis - errors are silently ignored.
|
397
|
-
"""
|
398
|
-
...
|
399
|
-
def publish(self, payload = None, force = True, ignore_errors = True):
|
400
|
-
"""
|
401
|
-
Publishes an event.
|
402
|
-
|
403
|
-
Note that the function returns immediately after the event has been sent. It
|
404
|
-
does not wait for flows to start, nor it guarantees that any flows will start.
|
405
|
-
|
406
|
-
Parameters
|
407
|
-
----------
|
408
|
-
payload : dict
|
409
|
-
Additional key-value pairs to add to the payload.
|
410
|
-
ignore_errors : bool, default True
|
411
|
-
If True, events are created on a best effort basis - errors are silently ignored.
|
412
|
-
"""
|
413
|
-
...
|
414
|
-
...
|
415
|
-
|
416
24
|
class ArgoWorkflowsInternalDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
417
25
|
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):
|
418
26
|
...
|