ob-metaflow-stubs 6.0.3.129__py2.py3-none-any.whl → 6.0.3.131__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 +254 -254
- 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 +4 -4
- metaflow-stubs/client/filecache.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 +3 -3
- 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 +4 -2
- metaflow-stubs/metaflow_current.pyi +57 -57
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +5 -5
- 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 +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +2 -2
- 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 +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
- 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 +3 -3
- metaflow-stubs/plugins/__init__.pyi +21 -13
- 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 +3 -9
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -5
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
- 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 +9 -10
- 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/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 +2 -2
- 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_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 +2 -2
- 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/components.pyi +2 -2
- 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 +2 -2
- 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 +3 -3
- 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 +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 +3 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +25 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +4 -21
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +12 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +10 -4
- 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 +2 -2
- 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 +6 -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 +4 -4
- 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 +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- 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 +13 -5
- 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 +2 -2
- 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/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_decorators.pyi +6 -6
- metaflow-stubs/user_configs/config_options.pyi +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +7 -7
- {ob_metaflow_stubs-6.0.3.129.dist-info → ob_metaflow_stubs-6.0.3.131.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.131.dist-info/RECORD +191 -0
- ob_metaflow_stubs-6.0.3.129.dist-info/RECORD +0 -191
- {ob_metaflow_stubs-6.0.3.129.dist-info → ob_metaflow_stubs-6.0.3.131.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.129.dist-info → ob_metaflow_stubs-6.0.3.131.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.13.
|
4
|
-
# Generated on
|
3
|
+
# MF version: 2.13.2.1+obcheckpoint(0.1.6);ob(v1) #
|
4
|
+
# Generated on 2025-01-08T23:52:28.392925 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -35,9 +35,9 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
|
|
35
35
|
from .user_configs.config_parameters import config_expr as config_expr
|
36
36
|
from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
|
37
37
|
from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
|
38
|
+
from . import tuple_util as tuple_util
|
38
39
|
from . import cards as cards
|
39
40
|
from . import events as events
|
40
|
-
from . import tuple_util as tuple_util
|
41
41
|
from . import runner as runner
|
42
42
|
from . import plugins as plugins
|
43
43
|
from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
|
@@ -146,6 +146,25 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
146
146
|
"""
|
147
147
|
...
|
148
148
|
|
149
|
+
@typing.overload
|
150
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
151
|
+
"""
|
152
|
+
Decorator prototype for all step decorators. This function gets specialized
|
153
|
+
and imported for all decorators types by _import_plugin_decorators().
|
154
|
+
"""
|
155
|
+
...
|
156
|
+
|
157
|
+
@typing.overload
|
158
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
159
|
+
...
|
160
|
+
|
161
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
162
|
+
"""
|
163
|
+
Decorator prototype for all step decorators. This function gets specialized
|
164
|
+
and imported for all decorators types by _import_plugin_decorators().
|
165
|
+
"""
|
166
|
+
...
|
167
|
+
|
149
168
|
@typing.overload
|
150
169
|
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]]]:
|
151
170
|
"""
|
@@ -167,79 +186,69 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
|
|
167
186
|
"""
|
168
187
|
...
|
169
188
|
|
189
|
+
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]]]:
|
190
|
+
"""
|
191
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
192
|
+
"""
|
193
|
+
...
|
194
|
+
|
170
195
|
@typing.overload
|
171
|
-
def
|
196
|
+
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]]]:
|
172
197
|
"""
|
173
|
-
Specifies the
|
174
|
-
to a step needs to be retried.
|
175
|
-
|
176
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
177
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
178
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
198
|
+
Specifies the Conda environment for the step.
|
179
199
|
|
180
|
-
|
181
|
-
|
182
|
-
|
200
|
+
Information in this decorator will augment any
|
201
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
202
|
+
you can use `@conda_base` to set packages required by all
|
203
|
+
steps and use `@conda` to specify step-specific overrides.
|
183
204
|
"""
|
184
205
|
...
|
185
206
|
|
186
207
|
@typing.overload
|
187
|
-
def
|
208
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
188
209
|
...
|
189
210
|
|
190
211
|
@typing.overload
|
191
|
-
def
|
212
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
192
213
|
...
|
193
214
|
|
194
|
-
def
|
215
|
+
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):
|
195
216
|
"""
|
196
|
-
Specifies the
|
197
|
-
to a step needs to be retried.
|
198
|
-
|
199
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
200
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
201
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
217
|
+
Specifies the Conda environment for the step.
|
202
218
|
|
203
|
-
|
204
|
-
|
205
|
-
|
219
|
+
Information in this decorator will augment any
|
220
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
221
|
+
you can use `@conda_base` to set packages required by all
|
222
|
+
steps and use `@conda` to specify step-specific overrides.
|
206
223
|
"""
|
207
224
|
...
|
208
225
|
|
209
|
-
|
210
|
-
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]]]:
|
226
|
+
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] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', 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]]]:
|
211
227
|
"""
|
212
|
-
|
213
|
-
|
214
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
228
|
+
Specifies that this step should execute on Kubernetes.
|
215
229
|
"""
|
216
230
|
...
|
217
231
|
|
218
232
|
@typing.overload
|
219
|
-
def
|
233
|
+
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]]]:
|
234
|
+
"""
|
235
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
236
|
+
the execution of a step.
|
237
|
+
"""
|
220
238
|
...
|
221
239
|
|
222
240
|
@typing.overload
|
223
|
-
def
|
224
|
-
...
|
225
|
-
|
226
|
-
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):
|
227
|
-
"""
|
228
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
229
|
-
|
230
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
231
|
-
"""
|
241
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
232
242
|
...
|
233
243
|
|
234
|
-
|
235
|
-
|
236
|
-
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
237
|
-
"""
|
244
|
+
@typing.overload
|
245
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
238
246
|
...
|
239
247
|
|
240
|
-
def
|
248
|
+
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]]] = []):
|
241
249
|
"""
|
242
|
-
Specifies
|
250
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
251
|
+
the execution of a step.
|
243
252
|
"""
|
244
253
|
...
|
245
254
|
|
@@ -275,47 +284,41 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
275
284
|
...
|
276
285
|
|
277
286
|
@typing.overload
|
278
|
-
def
|
287
|
+
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]]]:
|
279
288
|
"""
|
280
|
-
Specifies
|
281
|
-
|
282
|
-
This decorator is useful if this step may hang indefinitely.
|
289
|
+
Specifies the number of times the task corresponding
|
290
|
+
to a step needs to be retried.
|
283
291
|
|
284
|
-
This
|
285
|
-
|
286
|
-
|
292
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
293
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
294
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
287
295
|
|
288
|
-
|
289
|
-
|
296
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
297
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
298
|
+
ensuring that the flow execution can continue.
|
290
299
|
"""
|
291
300
|
...
|
292
301
|
|
293
302
|
@typing.overload
|
294
|
-
def
|
303
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
295
304
|
...
|
296
305
|
|
297
306
|
@typing.overload
|
298
|
-
def
|
307
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
299
308
|
...
|
300
309
|
|
301
|
-
def
|
310
|
+
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):
|
302
311
|
"""
|
303
|
-
Specifies
|
304
|
-
|
305
|
-
This decorator is useful if this step may hang indefinitely.
|
312
|
+
Specifies the number of times the task corresponding
|
313
|
+
to a step needs to be retried.
|
306
314
|
|
307
|
-
This
|
308
|
-
|
309
|
-
|
315
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
316
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
317
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
310
318
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
...
|
315
|
-
|
316
|
-
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]]]:
|
317
|
-
"""
|
318
|
-
Specifies that this step should execute on Kubernetes.
|
319
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
320
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
321
|
+
ensuring that the flow execution can continue.
|
319
322
|
"""
|
320
323
|
...
|
321
324
|
|
@@ -369,73 +372,93 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
369
372
|
...
|
370
373
|
|
371
374
|
@typing.overload
|
372
|
-
def
|
375
|
+
def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, 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]]]:
|
373
376
|
"""
|
374
|
-
|
375
|
-
|
376
|
-
Information in this decorator will augment any
|
377
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
378
|
-
you can use `@conda_base` to set packages required by all
|
379
|
-
steps and use `@conda` to specify step-specific overrides.
|
377
|
+
Enables loading / saving of models within a step.
|
380
378
|
"""
|
381
379
|
...
|
382
380
|
|
383
381
|
@typing.overload
|
384
|
-
def
|
382
|
+
def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
385
383
|
...
|
386
384
|
|
387
385
|
@typing.overload
|
388
|
-
def
|
386
|
+
def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
389
387
|
...
|
390
388
|
|
391
|
-
def
|
389
|
+
def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
|
392
390
|
"""
|
393
|
-
|
394
|
-
|
395
|
-
Information in this decorator will augment any
|
396
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
397
|
-
you can use `@conda_base` to set packages required by all
|
398
|
-
steps and use `@conda` to specify step-specific overrides.
|
391
|
+
Enables loading / saving of models within a step.
|
399
392
|
"""
|
400
393
|
...
|
401
394
|
|
402
395
|
@typing.overload
|
403
|
-
def
|
396
|
+
def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[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]]]:
|
404
397
|
"""
|
405
|
-
|
406
|
-
|
398
|
+
Specifies the PyPI packages for the step.
|
399
|
+
|
400
|
+
Information in this decorator will augment any
|
401
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
402
|
+
you can use `@pypi_base` to set packages required by all
|
403
|
+
steps and use `@pypi` to specify step-specific overrides.
|
407
404
|
"""
|
408
405
|
...
|
409
406
|
|
410
407
|
@typing.overload
|
411
|
-
def
|
408
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
412
409
|
...
|
413
410
|
|
414
|
-
|
411
|
+
@typing.overload
|
412
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
413
|
+
...
|
414
|
+
|
415
|
+
def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
415
416
|
"""
|
416
|
-
|
417
|
-
|
417
|
+
Specifies the PyPI packages for the step.
|
418
|
+
|
419
|
+
Information in this decorator will augment any
|
420
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
421
|
+
you can use `@pypi_base` to set packages required by all
|
422
|
+
steps and use `@pypi` to specify step-specific overrides.
|
418
423
|
"""
|
419
424
|
...
|
420
425
|
|
421
426
|
@typing.overload
|
422
|
-
def
|
427
|
+
def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> 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]]]:
|
423
428
|
"""
|
424
|
-
|
429
|
+
Specifies a timeout for your step.
|
430
|
+
|
431
|
+
This decorator is useful if this step may hang indefinitely.
|
432
|
+
|
433
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
434
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
435
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
436
|
+
|
437
|
+
Note that all the values specified in parameters are added together so if you specify
|
438
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
425
439
|
"""
|
426
440
|
...
|
427
441
|
|
428
442
|
@typing.overload
|
429
|
-
def
|
443
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
430
444
|
...
|
431
445
|
|
432
446
|
@typing.overload
|
433
|
-
def
|
447
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
434
448
|
...
|
435
449
|
|
436
|
-
def
|
450
|
+
def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
|
437
451
|
"""
|
438
|
-
|
452
|
+
Specifies a timeout for your step.
|
453
|
+
|
454
|
+
This decorator is useful if this step may hang indefinitely.
|
455
|
+
|
456
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
457
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
458
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
459
|
+
|
460
|
+
Note that all the values specified in parameters are added together so if you specify
|
461
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
439
462
|
"""
|
440
463
|
...
|
441
464
|
|
@@ -460,26 +483,9 @@ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
|
|
460
483
|
"""
|
461
484
|
...
|
462
485
|
|
463
|
-
|
464
|
-
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]]]:
|
465
|
-
"""
|
466
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
467
|
-
the execution of a step.
|
468
|
-
"""
|
469
|
-
...
|
470
|
-
|
471
|
-
@typing.overload
|
472
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
473
|
-
...
|
474
|
-
|
475
|
-
@typing.overload
|
476
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
477
|
-
...
|
478
|
-
|
479
|
-
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]]] = []):
|
486
|
+
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]]]:
|
480
487
|
"""
|
481
|
-
Specifies
|
482
|
-
the execution of a step.
|
488
|
+
Specifies that this step should execute on DGX cloud.
|
483
489
|
"""
|
484
490
|
...
|
485
491
|
|
@@ -501,50 +507,100 @@ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepF
|
|
501
507
|
...
|
502
508
|
|
503
509
|
@typing.overload
|
504
|
-
def
|
510
|
+
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]]]:
|
505
511
|
"""
|
506
|
-
|
512
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
507
513
|
|
508
|
-
|
509
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
510
|
-
you can use `@pypi_base` to set packages required by all
|
511
|
-
steps and use `@pypi` to specify step-specific overrides.
|
514
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
512
515
|
"""
|
513
516
|
...
|
514
517
|
|
515
518
|
@typing.overload
|
516
|
-
def
|
519
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
517
520
|
...
|
518
521
|
|
519
522
|
@typing.overload
|
520
|
-
def
|
523
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
521
524
|
...
|
522
525
|
|
523
|
-
def
|
526
|
+
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):
|
524
527
|
"""
|
525
|
-
|
528
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
526
529
|
|
527
|
-
|
528
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
529
|
-
you can use `@pypi_base` to set packages required by all
|
530
|
-
steps and use `@pypi` to specify step-specific overrides.
|
530
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
531
531
|
"""
|
532
532
|
...
|
533
533
|
|
534
|
-
|
534
|
+
@typing.overload
|
535
|
+
def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
535
536
|
"""
|
536
|
-
|
537
|
-
|
537
|
+
Specifies the event(s) that this flow depends on.
|
538
|
+
|
539
|
+
```
|
540
|
+
@trigger(event='foo')
|
541
|
+
```
|
542
|
+
or
|
543
|
+
```
|
544
|
+
@trigger(events=['foo', 'bar'])
|
545
|
+
```
|
546
|
+
|
547
|
+
Additionally, you can specify the parameter mappings
|
548
|
+
to map event payload to Metaflow parameters for the flow.
|
549
|
+
```
|
550
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
551
|
+
```
|
552
|
+
or
|
553
|
+
```
|
554
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
555
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
556
|
+
```
|
557
|
+
|
558
|
+
'parameters' can also be a list of strings and tuples like so:
|
559
|
+
```
|
560
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
561
|
+
```
|
562
|
+
This is equivalent to:
|
563
|
+
```
|
564
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
565
|
+
```
|
538
566
|
"""
|
539
567
|
...
|
540
568
|
|
541
|
-
|
569
|
+
@typing.overload
|
570
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
571
|
+
...
|
572
|
+
|
573
|
+
def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
542
574
|
"""
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
575
|
+
Specifies the event(s) that this flow depends on.
|
576
|
+
|
577
|
+
```
|
578
|
+
@trigger(event='foo')
|
579
|
+
```
|
580
|
+
or
|
581
|
+
```
|
582
|
+
@trigger(events=['foo', 'bar'])
|
583
|
+
```
|
584
|
+
|
585
|
+
Additionally, you can specify the parameter mappings
|
586
|
+
to map event payload to Metaflow parameters for the flow.
|
587
|
+
```
|
588
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
589
|
+
```
|
590
|
+
or
|
591
|
+
```
|
592
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
593
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
594
|
+
```
|
595
|
+
|
596
|
+
'parameters' can also be a list of strings and tuples like so:
|
597
|
+
```
|
598
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
599
|
+
```
|
600
|
+
This is equivalent to:
|
601
|
+
```
|
602
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
603
|
+
```
|
548
604
|
"""
|
549
605
|
...
|
550
606
|
|
@@ -557,6 +613,25 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
|
|
557
613
|
"""
|
558
614
|
...
|
559
615
|
|
616
|
+
@typing.overload
|
617
|
+
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]]:
|
618
|
+
"""
|
619
|
+
Specifies the times when the flow should be run when running on a
|
620
|
+
production scheduler.
|
621
|
+
"""
|
622
|
+
...
|
623
|
+
|
624
|
+
@typing.overload
|
625
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
626
|
+
...
|
627
|
+
|
628
|
+
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):
|
629
|
+
"""
|
630
|
+
Specifies the times when the flow should be run when running on a
|
631
|
+
production scheduler.
|
632
|
+
"""
|
633
|
+
...
|
634
|
+
|
560
635
|
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
561
636
|
"""
|
562
637
|
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
@@ -581,6 +656,39 @@ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[Fl
|
|
581
656
|
"""
|
582
657
|
...
|
583
658
|
|
659
|
+
@typing.overload
|
660
|
+
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]]:
|
661
|
+
"""
|
662
|
+
Specifies the Conda environment for all steps of the flow.
|
663
|
+
|
664
|
+
Use `@conda_base` to set common libraries required by all
|
665
|
+
steps and use `@conda` to specify step-specific additions.
|
666
|
+
"""
|
667
|
+
...
|
668
|
+
|
669
|
+
@typing.overload
|
670
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
671
|
+
...
|
672
|
+
|
673
|
+
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):
|
674
|
+
"""
|
675
|
+
Specifies the Conda environment for all steps of the flow.
|
676
|
+
|
677
|
+
Use `@conda_base` to set common libraries required by all
|
678
|
+
steps and use `@conda` to specify step-specific additions.
|
679
|
+
"""
|
680
|
+
...
|
681
|
+
|
682
|
+
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]]:
|
683
|
+
"""
|
684
|
+
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)
|
685
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
686
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
687
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
688
|
+
starts only after all sensors finish.
|
689
|
+
"""
|
690
|
+
...
|
691
|
+
|
584
692
|
@typing.overload
|
585
693
|
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]]:
|
586
694
|
"""
|
@@ -662,45 +770,10 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
662
770
|
"""
|
663
771
|
...
|
664
772
|
|
665
|
-
|
666
|
-
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]]:
|
667
|
-
"""
|
668
|
-
Specifies the times when the flow should be run when running on a
|
669
|
-
production scheduler.
|
670
|
-
"""
|
671
|
-
...
|
672
|
-
|
673
|
-
@typing.overload
|
674
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
675
|
-
...
|
676
|
-
|
677
|
-
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):
|
678
|
-
"""
|
679
|
-
Specifies the times when the flow should be run when running on a
|
680
|
-
production scheduler.
|
681
|
-
"""
|
682
|
-
...
|
683
|
-
|
684
|
-
@typing.overload
|
685
|
-
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]]:
|
686
|
-
"""
|
687
|
-
Specifies the Conda environment for all steps of the flow.
|
688
|
-
|
689
|
-
Use `@conda_base` to set common libraries required by all
|
690
|
-
steps and use `@conda` to specify step-specific additions.
|
691
|
-
"""
|
692
|
-
...
|
693
|
-
|
694
|
-
@typing.overload
|
695
|
-
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
696
|
-
...
|
697
|
-
|
698
|
-
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):
|
773
|
+
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]]:
|
699
774
|
"""
|
700
|
-
|
701
|
-
|
702
|
-
Use `@conda_base` to set common libraries required by all
|
703
|
-
steps and use `@conda` to specify step-specific additions.
|
775
|
+
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.
|
776
|
+
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.
|
704
777
|
"""
|
705
778
|
...
|
706
779
|
|
@@ -727,78 +800,5 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
|
|
727
800
|
"""
|
728
801
|
...
|
729
802
|
|
730
|
-
@typing.overload
|
731
|
-
def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
732
|
-
"""
|
733
|
-
Specifies the event(s) that this flow depends on.
|
734
|
-
|
735
|
-
```
|
736
|
-
@trigger(event='foo')
|
737
|
-
```
|
738
|
-
or
|
739
|
-
```
|
740
|
-
@trigger(events=['foo', 'bar'])
|
741
|
-
```
|
742
|
-
|
743
|
-
Additionally, you can specify the parameter mappings
|
744
|
-
to map event payload to Metaflow parameters for the flow.
|
745
|
-
```
|
746
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
747
|
-
```
|
748
|
-
or
|
749
|
-
```
|
750
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
751
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
752
|
-
```
|
753
|
-
|
754
|
-
'parameters' can also be a list of strings and tuples like so:
|
755
|
-
```
|
756
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
757
|
-
```
|
758
|
-
This is equivalent to:
|
759
|
-
```
|
760
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
761
|
-
```
|
762
|
-
"""
|
763
|
-
...
|
764
|
-
|
765
|
-
@typing.overload
|
766
|
-
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
767
|
-
...
|
768
|
-
|
769
|
-
def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
770
|
-
"""
|
771
|
-
Specifies the event(s) that this flow depends on.
|
772
|
-
|
773
|
-
```
|
774
|
-
@trigger(event='foo')
|
775
|
-
```
|
776
|
-
or
|
777
|
-
```
|
778
|
-
@trigger(events=['foo', 'bar'])
|
779
|
-
```
|
780
|
-
|
781
|
-
Additionally, you can specify the parameter mappings
|
782
|
-
to map event payload to Metaflow parameters for the flow.
|
783
|
-
```
|
784
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
785
|
-
```
|
786
|
-
or
|
787
|
-
```
|
788
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
789
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
790
|
-
```
|
791
|
-
|
792
|
-
'parameters' can also be a list of strings and tuples like so:
|
793
|
-
```
|
794
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
795
|
-
```
|
796
|
-
This is equivalent to:
|
797
|
-
```
|
798
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
799
|
-
```
|
800
|
-
"""
|
801
|
-
...
|
802
|
-
|
803
803
|
pkg_name: str
|
804
804
|
|