ob-metaflow-stubs 6.0.3.127__py2.py3-none-any.whl → 6.0.3.128__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 +282 -282
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +6 -6
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +5 -5
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +106 -106
- metaflow-stubs/mf_extensions/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +58 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +23 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +69 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +76 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +33 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +4 -4
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +4 -4
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +249 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +27 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +206 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +99 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +25 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +80 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +20 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +25 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +3 -3
- metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +5 -5
- metaflow-stubs/plugins/__init__.pyi +11 -11
- metaflow-stubs/plugins/airflow/__init__.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 +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
- 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_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.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_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
- 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 +2 -2
- 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 +6 -6
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- 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 +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
- 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 +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
- 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/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- 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 +3 -3
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +30 -30
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_decorators.pyi +6 -6
- metaflow-stubs/user_configs/config_options.pyi +4 -4
- metaflow-stubs/user_configs/config_parameters.pyi +6 -6
- {ob_metaflow_stubs-6.0.3.127.dist-info → ob_metaflow_stubs-6.0.3.128.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.128.dist-info/RECORD +191 -0
- ob_metaflow_stubs-6.0.3.127.dist-info/RECORD +0 -173
- {ob_metaflow_stubs-6.0.3.127.dist-info → ob_metaflow_stubs-6.0.3.128.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.127.dist-info → ob_metaflow_stubs-6.0.3.128.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.39.1+obcheckpoint(0.1.
|
4
|
-
# Generated on 2024-12-
|
3
|
+
# MF version: 2.12.39.1+obcheckpoint(0.1.6);ob(v1) #
|
4
|
+
# Generated on 2024-12-18T07:29:34.132398 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -34,9 +34,9 @@ from .user_configs.config_parameters import Config as Config
|
|
34
34
|
from .user_configs.config_parameters import config_expr as config_expr
|
35
35
|
from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
|
36
36
|
from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
|
37
|
-
from . import tuple_util as tuple_util
|
38
|
-
from . import cards as cards
|
39
37
|
from . import events as events
|
38
|
+
from . import cards as cards
|
39
|
+
from . import tuple_util as tuple_util
|
40
40
|
from . import runner as runner
|
41
41
|
from . import plugins as plugins
|
42
42
|
from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
|
@@ -145,161 +145,40 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
145
145
|
"""
|
146
146
|
...
|
147
147
|
|
148
|
-
|
149
|
-
def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
150
|
-
"""
|
151
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
152
|
-
|
153
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
154
|
-
"""
|
155
|
-
...
|
156
|
-
|
157
|
-
@typing.overload
|
158
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
159
|
-
...
|
160
|
-
|
161
|
-
@typing.overload
|
162
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
163
|
-
...
|
164
|
-
|
165
|
-
def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
|
166
|
-
"""
|
167
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
168
|
-
|
169
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
170
|
-
"""
|
171
|
-
...
|
172
|
-
|
173
|
-
@typing.overload
|
174
|
-
def checkpoint(*, load_policy: str = 'fresh', temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
175
|
-
"""
|
176
|
-
Enables checkpointing for a step.
|
177
|
-
"""
|
178
|
-
...
|
179
|
-
|
180
|
-
@typing.overload
|
181
|
-
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
182
|
-
...
|
183
|
-
|
184
|
-
@typing.overload
|
185
|
-
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
186
|
-
...
|
187
|
-
|
188
|
-
def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = 'fresh', temp_dir_root: str = None):
|
189
|
-
"""
|
190
|
-
Enables checkpointing for a step.
|
191
|
-
"""
|
192
|
-
...
|
193
|
-
|
194
|
-
@typing.overload
|
195
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
196
|
-
"""
|
197
|
-
Decorator prototype for all step decorators. This function gets specialized
|
198
|
-
and imported for all decorators types by _import_plugin_decorators().
|
199
|
-
"""
|
200
|
-
...
|
201
|
-
|
202
|
-
@typing.overload
|
203
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
204
|
-
...
|
205
|
-
|
206
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
207
|
-
"""
|
208
|
-
Decorator prototype for all step decorators. This function gets specialized
|
209
|
-
and imported for all decorators types by _import_plugin_decorators().
|
210
|
-
"""
|
211
|
-
...
|
212
|
-
|
213
|
-
@typing.overload
|
214
|
-
def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
215
|
-
"""
|
216
|
-
Specifies the number of times the task corresponding
|
217
|
-
to a step needs to be retried.
|
218
|
-
|
219
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
220
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
221
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
222
|
-
|
223
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
224
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
225
|
-
ensuring that the flow execution can continue.
|
226
|
-
"""
|
227
|
-
...
|
228
|
-
|
229
|
-
@typing.overload
|
230
|
-
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
231
|
-
...
|
232
|
-
|
233
|
-
@typing.overload
|
234
|
-
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
235
|
-
...
|
236
|
-
|
237
|
-
def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
|
238
|
-
"""
|
239
|
-
Specifies the number of times the task corresponding
|
240
|
-
to a step needs to be retried.
|
241
|
-
|
242
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
243
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
244
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
245
|
-
|
246
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
247
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
248
|
-
ensuring that the flow execution can continue.
|
249
|
-
"""
|
250
|
-
...
|
251
|
-
|
252
|
-
@typing.overload
|
253
|
-
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
254
|
-
"""
|
255
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
256
|
-
the execution of a step.
|
257
|
-
"""
|
258
|
-
...
|
259
|
-
|
260
|
-
@typing.overload
|
261
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
262
|
-
...
|
263
|
-
|
264
|
-
@typing.overload
|
265
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
266
|
-
...
|
267
|
-
|
268
|
-
def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []):
|
148
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable') -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
269
149
|
"""
|
270
|
-
Specifies
|
271
|
-
the execution of a step.
|
150
|
+
Specifies that this step should execute on Kubernetes.
|
272
151
|
"""
|
273
152
|
...
|
274
153
|
|
275
154
|
@typing.overload
|
276
|
-
def
|
155
|
+
def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
277
156
|
"""
|
278
|
-
Specifies
|
157
|
+
Specifies the Conda environment for the step.
|
279
158
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
159
|
+
Information in this decorator will augment any
|
160
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
161
|
+
you can use `@conda_base` to set packages required by all
|
162
|
+
steps and use `@conda` to specify step-specific overrides.
|
284
163
|
"""
|
285
164
|
...
|
286
165
|
|
287
166
|
@typing.overload
|
288
|
-
def
|
167
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
289
168
|
...
|
290
169
|
|
291
170
|
@typing.overload
|
292
|
-
def
|
171
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
293
172
|
...
|
294
173
|
|
295
|
-
def
|
174
|
+
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
296
175
|
"""
|
297
|
-
Specifies
|
176
|
+
Specifies the Conda environment for the step.
|
298
177
|
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
178
|
+
Information in this decorator will augment any
|
179
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
180
|
+
you can use `@conda_base` to set packages required by all
|
181
|
+
steps and use `@conda` to specify step-specific overrides.
|
303
182
|
"""
|
304
183
|
...
|
305
184
|
|
@@ -384,33 +263,50 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
384
263
|
...
|
385
264
|
|
386
265
|
@typing.overload
|
387
|
-
def
|
266
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
388
267
|
"""
|
389
|
-
|
268
|
+
Internal decorator to support Fast bakery
|
269
|
+
"""
|
270
|
+
...
|
271
|
+
|
272
|
+
@typing.overload
|
273
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
274
|
+
...
|
275
|
+
|
276
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
277
|
+
"""
|
278
|
+
Internal decorator to support Fast bakery
|
279
|
+
"""
|
280
|
+
...
|
281
|
+
|
282
|
+
@typing.overload
|
283
|
+
def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
284
|
+
"""
|
285
|
+
Specifies that the step will success under all circumstances.
|
390
286
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
287
|
+
The decorator will create an optional artifact, specified by `var`, which
|
288
|
+
contains the exception raised. You can use it to detect the presence
|
289
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
290
|
+
are missing.
|
395
291
|
"""
|
396
292
|
...
|
397
293
|
|
398
294
|
@typing.overload
|
399
|
-
def
|
295
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
400
296
|
...
|
401
297
|
|
402
298
|
@typing.overload
|
403
|
-
def
|
299
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
404
300
|
...
|
405
301
|
|
406
|
-
def
|
302
|
+
def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
|
407
303
|
"""
|
408
|
-
Specifies the
|
304
|
+
Specifies that the step will success under all circumstances.
|
409
305
|
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
306
|
+
The decorator will create an optional artifact, specified by `var`, which
|
307
|
+
contains the exception raised. You can use it to detect the presence
|
308
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
309
|
+
are missing.
|
414
310
|
"""
|
415
311
|
...
|
416
312
|
|
@@ -436,58 +332,137 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
436
332
|
...
|
437
333
|
|
438
334
|
@typing.overload
|
439
|
-
def
|
335
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
440
336
|
"""
|
441
|
-
|
337
|
+
Decorator prototype for all step decorators. This function gets specialized
|
338
|
+
and imported for all decorators types by _import_plugin_decorators().
|
442
339
|
"""
|
443
340
|
...
|
444
341
|
|
445
342
|
@typing.overload
|
446
|
-
def
|
447
|
-
...
|
448
|
-
|
449
|
-
@typing.overload
|
450
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
343
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
451
344
|
...
|
452
345
|
|
453
|
-
def
|
346
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
454
347
|
"""
|
455
|
-
|
348
|
+
Decorator prototype for all step decorators. This function gets specialized
|
349
|
+
and imported for all decorators types by _import_plugin_decorators().
|
456
350
|
"""
|
457
351
|
...
|
458
352
|
|
459
|
-
|
353
|
+
@typing.overload
|
354
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
460
355
|
"""
|
461
|
-
Specifies
|
356
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
357
|
+
the execution of a step.
|
462
358
|
"""
|
463
359
|
...
|
464
360
|
|
465
|
-
|
466
|
-
|
467
|
-
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
468
|
-
"""
|
361
|
+
@typing.overload
|
362
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
469
363
|
...
|
470
364
|
|
471
|
-
|
365
|
+
@typing.overload
|
366
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
367
|
+
...
|
368
|
+
|
369
|
+
def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []):
|
472
370
|
"""
|
473
|
-
Specifies
|
371
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
372
|
+
the execution of a step.
|
474
373
|
"""
|
475
374
|
...
|
476
375
|
|
477
376
|
@typing.overload
|
478
|
-
def
|
377
|
+
def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
479
378
|
"""
|
480
|
-
|
379
|
+
Specifies the number of times the task corresponding
|
380
|
+
to a step needs to be retried.
|
381
|
+
|
382
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
383
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
384
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
385
|
+
|
386
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
387
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
388
|
+
ensuring that the flow execution can continue.
|
481
389
|
"""
|
482
390
|
...
|
483
391
|
|
484
392
|
@typing.overload
|
485
|
-
def
|
393
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
486
394
|
...
|
487
395
|
|
488
|
-
|
489
|
-
|
490
|
-
|
396
|
+
@typing.overload
|
397
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
398
|
+
...
|
399
|
+
|
400
|
+
def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
|
401
|
+
"""
|
402
|
+
Specifies the number of times the task corresponding
|
403
|
+
to a step needs to be retried.
|
404
|
+
|
405
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
406
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
407
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
408
|
+
|
409
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
410
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
411
|
+
ensuring that the flow execution can continue.
|
412
|
+
"""
|
413
|
+
...
|
414
|
+
|
415
|
+
@typing.overload
|
416
|
+
def checkpoint(*, load_policy: str = 'fresh', temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
417
|
+
"""
|
418
|
+
Enables checkpointing for a step.
|
419
|
+
"""
|
420
|
+
...
|
421
|
+
|
422
|
+
@typing.overload
|
423
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
424
|
+
...
|
425
|
+
|
426
|
+
@typing.overload
|
427
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
428
|
+
...
|
429
|
+
|
430
|
+
def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = 'fresh', temp_dir_root: str = None):
|
431
|
+
"""
|
432
|
+
Enables checkpointing for a step.
|
433
|
+
"""
|
434
|
+
...
|
435
|
+
|
436
|
+
def nvidia(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
437
|
+
"""
|
438
|
+
Specifies that this step should execute on DGX cloud.
|
439
|
+
"""
|
440
|
+
...
|
441
|
+
|
442
|
+
@typing.overload
|
443
|
+
def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
444
|
+
"""
|
445
|
+
Specifies environment variables to be set prior to the execution of a step.
|
446
|
+
"""
|
447
|
+
...
|
448
|
+
|
449
|
+
@typing.overload
|
450
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
451
|
+
...
|
452
|
+
|
453
|
+
@typing.overload
|
454
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
455
|
+
...
|
456
|
+
|
457
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
458
|
+
"""
|
459
|
+
Specifies environment variables to be set prior to the execution of a step.
|
460
|
+
"""
|
461
|
+
...
|
462
|
+
|
463
|
+
def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], None]) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
464
|
+
"""
|
465
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
491
466
|
"""
|
492
467
|
...
|
493
468
|
|
@@ -531,113 +506,79 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
531
506
|
...
|
532
507
|
|
533
508
|
@typing.overload
|
534
|
-
def
|
509
|
+
def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
535
510
|
"""
|
536
|
-
|
511
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
537
512
|
|
538
|
-
|
539
|
-
steps and use `@conda` to specify step-specific additions.
|
513
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
540
514
|
"""
|
541
515
|
...
|
542
516
|
|
543
517
|
@typing.overload
|
544
|
-
def
|
518
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
545
519
|
...
|
546
520
|
|
547
|
-
|
521
|
+
@typing.overload
|
522
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
523
|
+
...
|
524
|
+
|
525
|
+
def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
|
548
526
|
"""
|
549
|
-
|
527
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
550
528
|
|
551
|
-
|
552
|
-
steps and use `@conda` to specify step-specific additions.
|
529
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
553
530
|
"""
|
554
531
|
...
|
555
532
|
|
556
|
-
|
533
|
+
@typing.overload
|
534
|
+
def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
557
535
|
"""
|
558
|
-
|
559
|
-
|
536
|
+
Specifies the times when the flow should be run when running on a
|
537
|
+
production scheduler.
|
560
538
|
"""
|
561
539
|
...
|
562
540
|
|
563
541
|
@typing.overload
|
564
|
-
def
|
542
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
543
|
+
...
|
544
|
+
|
545
|
+
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
565
546
|
"""
|
566
|
-
Specifies the
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
This decorator respects the @project decorator and triggers the flow
|
576
|
-
when upstream runs within the same namespace complete successfully
|
577
|
-
|
578
|
-
Additionally, you can specify project aware upstream flow dependencies
|
579
|
-
by specifying the fully qualified project_flow_name.
|
580
|
-
```
|
581
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
582
|
-
```
|
583
|
-
or
|
584
|
-
```
|
585
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
586
|
-
```
|
587
|
-
|
588
|
-
You can also specify just the project or project branch (other values will be
|
589
|
-
inferred from the current project or project branch):
|
590
|
-
```
|
591
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
592
|
-
```
|
547
|
+
Specifies the times when the flow should be run when running on a
|
548
|
+
production scheduler.
|
549
|
+
"""
|
550
|
+
...
|
551
|
+
|
552
|
+
@typing.overload
|
553
|
+
def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
554
|
+
"""
|
555
|
+
Specifies the Conda environment for all steps of the flow.
|
593
556
|
|
594
|
-
|
595
|
-
|
596
|
-
- `user.bob`
|
597
|
-
- `test.my_experiment`
|
598
|
-
- `prod.staging`
|
557
|
+
Use `@conda_base` to set common libraries required by all
|
558
|
+
steps and use `@conda` to specify step-specific additions.
|
599
559
|
"""
|
600
560
|
...
|
601
561
|
|
602
562
|
@typing.overload
|
603
|
-
def
|
563
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
604
564
|
...
|
605
565
|
|
606
|
-
def
|
566
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
607
567
|
"""
|
608
|
-
Specifies the
|
609
|
-
|
610
|
-
```
|
611
|
-
@trigger_on_finish(flow='FooFlow')
|
612
|
-
```
|
613
|
-
or
|
614
|
-
```
|
615
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
616
|
-
```
|
617
|
-
This decorator respects the @project decorator and triggers the flow
|
618
|
-
when upstream runs within the same namespace complete successfully
|
619
|
-
|
620
|
-
Additionally, you can specify project aware upstream flow dependencies
|
621
|
-
by specifying the fully qualified project_flow_name.
|
622
|
-
```
|
623
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
624
|
-
```
|
625
|
-
or
|
626
|
-
```
|
627
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
628
|
-
```
|
629
|
-
|
630
|
-
You can also specify just the project or project branch (other values will be
|
631
|
-
inferred from the current project or project branch):
|
632
|
-
```
|
633
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
634
|
-
```
|
568
|
+
Specifies the Conda environment for all steps of the flow.
|
635
569
|
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
570
|
+
Use `@conda_base` to set common libraries required by all
|
571
|
+
steps and use `@conda` to specify step-specific additions.
|
572
|
+
"""
|
573
|
+
...
|
574
|
+
|
575
|
+
def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
576
|
+
"""
|
577
|
+
The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
|
578
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
579
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
580
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
581
|
+
starts only after all sensors finish.
|
641
582
|
"""
|
642
583
|
...
|
643
584
|
|
@@ -737,6 +678,22 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
|
|
737
678
|
"""
|
738
679
|
...
|
739
680
|
|
681
|
+
def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
682
|
+
"""
|
683
|
+
The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
|
684
|
+
This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
|
685
|
+
"""
|
686
|
+
...
|
687
|
+
|
688
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
689
|
+
"""
|
690
|
+
Specifies what flows belong to the same project.
|
691
|
+
|
692
|
+
A project-specific namespace is created for all flows that
|
693
|
+
use the same `@project(name)`.
|
694
|
+
"""
|
695
|
+
...
|
696
|
+
|
740
697
|
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
741
698
|
"""
|
742
699
|
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
@@ -762,40 +719,83 @@ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[Fl
|
|
762
719
|
...
|
763
720
|
|
764
721
|
@typing.overload
|
765
|
-
def
|
722
|
+
def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
766
723
|
"""
|
767
|
-
Specifies the
|
768
|
-
|
724
|
+
Specifies the flow(s) that this flow depends on.
|
725
|
+
|
726
|
+
```
|
727
|
+
@trigger_on_finish(flow='FooFlow')
|
728
|
+
```
|
729
|
+
or
|
730
|
+
```
|
731
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
732
|
+
```
|
733
|
+
This decorator respects the @project decorator and triggers the flow
|
734
|
+
when upstream runs within the same namespace complete successfully
|
735
|
+
|
736
|
+
Additionally, you can specify project aware upstream flow dependencies
|
737
|
+
by specifying the fully qualified project_flow_name.
|
738
|
+
```
|
739
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
740
|
+
```
|
741
|
+
or
|
742
|
+
```
|
743
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
744
|
+
```
|
745
|
+
|
746
|
+
You can also specify just the project or project branch (other values will be
|
747
|
+
inferred from the current project or project branch):
|
748
|
+
```
|
749
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
750
|
+
```
|
751
|
+
|
752
|
+
Note that `branch` is typically one of:
|
753
|
+
- `prod`
|
754
|
+
- `user.bob`
|
755
|
+
- `test.my_experiment`
|
756
|
+
- `prod.staging`
|
769
757
|
"""
|
770
758
|
...
|
771
759
|
|
772
760
|
@typing.overload
|
773
|
-
def
|
774
|
-
...
|
775
|
-
|
776
|
-
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
777
|
-
"""
|
778
|
-
Specifies the times when the flow should be run when running on a
|
779
|
-
production scheduler.
|
780
|
-
"""
|
781
|
-
...
|
782
|
-
|
783
|
-
def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
784
|
-
"""
|
785
|
-
The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
|
786
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
787
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
788
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
789
|
-
starts only after all sensors finish.
|
790
|
-
"""
|
761
|
+
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
791
762
|
...
|
792
763
|
|
793
|
-
def
|
764
|
+
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
794
765
|
"""
|
795
|
-
Specifies
|
766
|
+
Specifies the flow(s) that this flow depends on.
|
796
767
|
|
797
|
-
|
798
|
-
|
768
|
+
```
|
769
|
+
@trigger_on_finish(flow='FooFlow')
|
770
|
+
```
|
771
|
+
or
|
772
|
+
```
|
773
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
774
|
+
```
|
775
|
+
This decorator respects the @project decorator and triggers the flow
|
776
|
+
when upstream runs within the same namespace complete successfully
|
777
|
+
|
778
|
+
Additionally, you can specify project aware upstream flow dependencies
|
779
|
+
by specifying the fully qualified project_flow_name.
|
780
|
+
```
|
781
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
782
|
+
```
|
783
|
+
or
|
784
|
+
```
|
785
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
786
|
+
```
|
787
|
+
|
788
|
+
You can also specify just the project or project branch (other values will be
|
789
|
+
inferred from the current project or project branch):
|
790
|
+
```
|
791
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
792
|
+
```
|
793
|
+
|
794
|
+
Note that `branch` is typically one of:
|
795
|
+
- `prod`
|
796
|
+
- `user.bob`
|
797
|
+
- `test.my_experiment`
|
798
|
+
- `prod.staging`
|
799
799
|
"""
|
800
800
|
...
|
801
801
|
|