metaflow-stubs 2.18.5__py2.py3-none-any.whl → 2.18.6__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of metaflow-stubs might be problematic. Click here for more details.
- metaflow-stubs/__init__.pyi +451 -451
- 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 +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 +2 -2
- metaflow-stubs/meta_files.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 +3 -3
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +4 -4
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/packaging_sys/__init__.pyi +4 -4
- metaflow-stubs/packaging_sys/backend.pyi +2 -2
- metaflow-stubs/packaging_sys/distribution_support.pyi +3 -3
- metaflow-stubs/packaging_sys/tar_backend.pyi +7 -7
- metaflow-stubs/packaging_sys/utils.pyi +2 -2
- metaflow-stubs/packaging_sys/v1.pyi +3 -3
- metaflow-stubs/parameters.pyi +2 -2
- metaflow-stubs/plugins/__init__.pyi +14 -14
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +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 -3
- 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/argo/exit_hooks.pyi +2 -2
- 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 +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/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_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +4 -4
- 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 +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 +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +5 -5
- 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 +2 -2
- 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 +45 -4
- metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
- metaflow-stubs/plugins/exit_hook/exit_hook_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 +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.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/parsers.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
- metaflow-stubs/plugins/secrets/utils.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 +2 -2
- metaflow-stubs/plugins/uv/__init__.pyi +2 -2
- metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +34 -34
- 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 +4 -4
- 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_options.pyi +3 -3
- metaflow-stubs/user_configs/config_parameters.pyi +5 -5
- metaflow-stubs/user_decorators/__init__.pyi +2 -2
- metaflow-stubs/user_decorators/common.pyi +2 -2
- metaflow-stubs/user_decorators/mutable_flow.pyi +6 -6
- metaflow-stubs/user_decorators/mutable_step.pyi +5 -5
- metaflow-stubs/user_decorators/user_flow_decorator.pyi +4 -4
- metaflow-stubs/user_decorators/user_step_decorator.pyi +5 -5
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.18.5.dist-info → metaflow_stubs-2.18.6.dist-info}/METADATA +2 -2
- metaflow_stubs-2.18.6.dist-info/RECORD +166 -0
- metaflow_stubs-2.18.5.dist-info/RECORD +0 -166
- {metaflow_stubs-2.18.5.dist-info → metaflow_stubs-2.18.6.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.18.5.dist-info → metaflow_stubs-2.18.6.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.18.
|
|
4
|
-
# Generated on 2025-09-
|
|
3
|
+
# MF version: 2.18.6 #
|
|
4
|
+
# Generated on 2025-09-17T19:37:30.074072 #
|
|
5
5
|
######################################################################################################
|
|
6
6
|
|
|
7
7
|
from __future__ import annotations
|
|
@@ -39,17 +39,17 @@ from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDe
|
|
|
39
39
|
from .user_decorators.user_step_decorator import StepMutator as StepMutator
|
|
40
40
|
from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
|
|
41
41
|
from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
|
|
42
|
-
from . import metaflow_git as metaflow_git
|
|
43
42
|
from . import events as events
|
|
44
43
|
from . import tuple_util as tuple_util
|
|
44
|
+
from . import metaflow_git as metaflow_git
|
|
45
45
|
from . import runner as runner
|
|
46
46
|
from . import plugins as plugins
|
|
47
47
|
from .plugins.datatools.s3.s3 import S3 as S3
|
|
48
48
|
from . import includefile as includefile
|
|
49
49
|
from .includefile import IncludeFile as IncludeFile
|
|
50
|
+
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
50
51
|
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
|
51
52
|
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
|
52
|
-
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
|
53
53
|
from . import cards as cards
|
|
54
54
|
from . import client as client
|
|
55
55
|
from .client.core import namespace as namespace
|
|
@@ -152,174 +152,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
|
152
152
|
"""
|
|
153
153
|
...
|
|
154
154
|
|
|
155
|
-
@typing.overload
|
|
156
|
-
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]]]:
|
|
157
|
-
"""
|
|
158
|
-
Specifies that the step will success under all circumstances.
|
|
159
|
-
|
|
160
|
-
The decorator will create an optional artifact, specified by `var`, which
|
|
161
|
-
contains the exception raised. You can use it to detect the presence
|
|
162
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
|
163
|
-
are missing.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
Parameters
|
|
167
|
-
----------
|
|
168
|
-
var : str, optional, default None
|
|
169
|
-
Name of the artifact in which to store the caught exception.
|
|
170
|
-
If not specified, the exception is not stored.
|
|
171
|
-
print_exception : bool, default True
|
|
172
|
-
Determines whether or not the exception is printed to
|
|
173
|
-
stdout when caught.
|
|
174
|
-
"""
|
|
175
|
-
...
|
|
176
|
-
|
|
177
|
-
@typing.overload
|
|
178
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
179
|
-
...
|
|
180
|
-
|
|
181
|
-
@typing.overload
|
|
182
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
183
|
-
...
|
|
184
|
-
|
|
185
|
-
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):
|
|
186
|
-
"""
|
|
187
|
-
Specifies that the step will success under all circumstances.
|
|
188
|
-
|
|
189
|
-
The decorator will create an optional artifact, specified by `var`, which
|
|
190
|
-
contains the exception raised. You can use it to detect the presence
|
|
191
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
|
192
|
-
are missing.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
Parameters
|
|
196
|
-
----------
|
|
197
|
-
var : str, optional, default None
|
|
198
|
-
Name of the artifact in which to store the caught exception.
|
|
199
|
-
If not specified, the exception is not stored.
|
|
200
|
-
print_exception : bool, default True
|
|
201
|
-
Determines whether or not the exception is printed to
|
|
202
|
-
stdout when caught.
|
|
203
|
-
"""
|
|
204
|
-
...
|
|
205
|
-
|
|
206
|
-
@typing.overload
|
|
207
|
-
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]]]:
|
|
208
|
-
"""
|
|
209
|
-
Specifies the Conda environment for the step.
|
|
210
|
-
|
|
211
|
-
Information in this decorator will augment any
|
|
212
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
213
|
-
you can use `@conda_base` to set packages required by all
|
|
214
|
-
steps and use `@conda` to specify step-specific overrides.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
Parameters
|
|
218
|
-
----------
|
|
219
|
-
packages : Dict[str, str], default {}
|
|
220
|
-
Packages to use for this step. The key is the name of the package
|
|
221
|
-
and the value is the version to use.
|
|
222
|
-
libraries : Dict[str, str], default {}
|
|
223
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
224
|
-
python : str, optional, default None
|
|
225
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
226
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
227
|
-
disabled : bool, default False
|
|
228
|
-
If set to True, disables @conda.
|
|
229
|
-
"""
|
|
230
|
-
...
|
|
231
|
-
|
|
232
|
-
@typing.overload
|
|
233
|
-
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
234
|
-
...
|
|
235
|
-
|
|
236
|
-
@typing.overload
|
|
237
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
238
|
-
...
|
|
239
|
-
|
|
240
|
-
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):
|
|
241
|
-
"""
|
|
242
|
-
Specifies the Conda environment for the step.
|
|
243
|
-
|
|
244
|
-
Information in this decorator will augment any
|
|
245
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
246
|
-
you can use `@conda_base` to set packages required by all
|
|
247
|
-
steps and use `@conda` to specify step-specific overrides.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
Parameters
|
|
251
|
-
----------
|
|
252
|
-
packages : Dict[str, str], default {}
|
|
253
|
-
Packages to use for this step. The key is the name of the package
|
|
254
|
-
and the value is the version to use.
|
|
255
|
-
libraries : Dict[str, str], default {}
|
|
256
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
257
|
-
python : str, optional, default None
|
|
258
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
259
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
260
|
-
disabled : bool, default False
|
|
261
|
-
If set to True, disables @conda.
|
|
262
|
-
"""
|
|
263
|
-
...
|
|
264
|
-
|
|
265
|
-
@typing.overload
|
|
266
|
-
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: 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]]]:
|
|
267
|
-
"""
|
|
268
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
269
|
-
the execution of a step.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
Parameters
|
|
273
|
-
----------
|
|
274
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
275
|
-
List of secret specs, defining how the secrets are to be retrieved
|
|
276
|
-
role : str, optional, default: None
|
|
277
|
-
Role to use for fetching secrets
|
|
278
|
-
"""
|
|
279
|
-
...
|
|
280
|
-
|
|
281
|
-
@typing.overload
|
|
282
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
283
|
-
...
|
|
284
|
-
|
|
285
|
-
@typing.overload
|
|
286
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
287
|
-
...
|
|
288
|
-
|
|
289
|
-
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]]] = [], role: typing.Optional[str] = None):
|
|
290
|
-
"""
|
|
291
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
292
|
-
the execution of a step.
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
Parameters
|
|
296
|
-
----------
|
|
297
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
298
|
-
List of secret specs, defining how the secrets are to be retrieved
|
|
299
|
-
role : str, optional, default: None
|
|
300
|
-
Role to use for fetching secrets
|
|
301
|
-
"""
|
|
302
|
-
...
|
|
303
|
-
|
|
304
|
-
@typing.overload
|
|
305
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
306
|
-
"""
|
|
307
|
-
Decorator prototype for all step decorators. This function gets specialized
|
|
308
|
-
and imported for all decorators types by _import_plugin_decorators().
|
|
309
|
-
"""
|
|
310
|
-
...
|
|
311
|
-
|
|
312
|
-
@typing.overload
|
|
313
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
314
|
-
...
|
|
315
|
-
|
|
316
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
317
|
-
"""
|
|
318
|
-
Decorator prototype for all step decorators. This function gets specialized
|
|
319
|
-
and imported for all decorators types by _import_plugin_decorators().
|
|
320
|
-
"""
|
|
321
|
-
...
|
|
322
|
-
|
|
323
155
|
@typing.overload
|
|
324
156
|
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]]]:
|
|
325
157
|
"""
|
|
@@ -531,96 +363,130 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
|
531
363
|
...
|
|
532
364
|
|
|
533
365
|
@typing.overload
|
|
534
|
-
def
|
|
366
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
535
367
|
"""
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
This decorator is useful if this step may hang indefinitely.
|
|
539
|
-
|
|
540
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
541
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
542
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
543
|
-
|
|
544
|
-
Note that all the values specified in parameters are added together so if you specify
|
|
545
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
Parameters
|
|
549
|
-
----------
|
|
550
|
-
seconds : int, default 0
|
|
551
|
-
Number of seconds to wait prior to timing out.
|
|
552
|
-
minutes : int, default 0
|
|
553
|
-
Number of minutes to wait prior to timing out.
|
|
554
|
-
hours : int, default 0
|
|
555
|
-
Number of hours to wait prior to timing out.
|
|
368
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
369
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
556
370
|
"""
|
|
557
371
|
...
|
|
558
372
|
|
|
559
373
|
@typing.overload
|
|
560
|
-
def
|
|
561
|
-
...
|
|
562
|
-
|
|
563
|
-
@typing.overload
|
|
564
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
374
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
565
375
|
...
|
|
566
376
|
|
|
567
|
-
def
|
|
377
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
|
568
378
|
"""
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
This decorator is useful if this step may hang indefinitely.
|
|
572
|
-
|
|
573
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
574
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
575
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
576
|
-
|
|
577
|
-
Note that all the values specified in parameters are added together so if you specify
|
|
578
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
Parameters
|
|
582
|
-
----------
|
|
583
|
-
seconds : int, default 0
|
|
584
|
-
Number of seconds to wait prior to timing out.
|
|
585
|
-
minutes : int, default 0
|
|
586
|
-
Number of minutes to wait prior to timing out.
|
|
587
|
-
hours : int, default 0
|
|
588
|
-
Number of hours to wait prior to timing out.
|
|
379
|
+
Decorator prototype for all step decorators. This function gets specialized
|
|
380
|
+
and imported for all decorators types by _import_plugin_decorators().
|
|
589
381
|
"""
|
|
590
382
|
...
|
|
591
383
|
|
|
592
384
|
@typing.overload
|
|
593
|
-
def
|
|
385
|
+
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]]]:
|
|
594
386
|
"""
|
|
595
|
-
|
|
387
|
+
Specifies the PyPI packages for the step.
|
|
596
388
|
|
|
597
|
-
|
|
389
|
+
Information in this decorator will augment any
|
|
390
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
391
|
+
you can use `@pypi_base` to set packages required by all
|
|
392
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
598
393
|
|
|
599
394
|
|
|
600
395
|
Parameters
|
|
601
396
|
----------
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
timeout : int, default 45
|
|
609
|
-
Interrupt reporting if it takes more than this many seconds.
|
|
397
|
+
packages : Dict[str, str], default: {}
|
|
398
|
+
Packages to use for this step. The key is the name of the package
|
|
399
|
+
and the value is the version to use.
|
|
400
|
+
python : str, optional, default: None
|
|
401
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
402
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
610
403
|
"""
|
|
611
404
|
...
|
|
612
405
|
|
|
613
406
|
@typing.overload
|
|
614
|
-
def
|
|
407
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
615
408
|
...
|
|
616
409
|
|
|
617
410
|
@typing.overload
|
|
618
|
-
def
|
|
411
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
619
412
|
...
|
|
620
413
|
|
|
621
|
-
def
|
|
414
|
+
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):
|
|
622
415
|
"""
|
|
623
|
-
|
|
416
|
+
Specifies the PyPI packages for the step.
|
|
417
|
+
|
|
418
|
+
Information in this decorator will augment any
|
|
419
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
420
|
+
you can use `@pypi_base` to set packages required by all
|
|
421
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
Parameters
|
|
425
|
+
----------
|
|
426
|
+
packages : Dict[str, str], default: {}
|
|
427
|
+
Packages to use for this step. The key is the name of the package
|
|
428
|
+
and the value is the version to use.
|
|
429
|
+
python : str, optional, default: None
|
|
430
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
431
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
432
|
+
"""
|
|
433
|
+
...
|
|
434
|
+
|
|
435
|
+
@typing.overload
|
|
436
|
+
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]]]:
|
|
437
|
+
"""
|
|
438
|
+
Specifies that the step will success under all circumstances.
|
|
439
|
+
|
|
440
|
+
The decorator will create an optional artifact, specified by `var`, which
|
|
441
|
+
contains the exception raised. You can use it to detect the presence
|
|
442
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
|
443
|
+
are missing.
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
Parameters
|
|
447
|
+
----------
|
|
448
|
+
var : str, optional, default None
|
|
449
|
+
Name of the artifact in which to store the caught exception.
|
|
450
|
+
If not specified, the exception is not stored.
|
|
451
|
+
print_exception : bool, default True
|
|
452
|
+
Determines whether or not the exception is printed to
|
|
453
|
+
stdout when caught.
|
|
454
|
+
"""
|
|
455
|
+
...
|
|
456
|
+
|
|
457
|
+
@typing.overload
|
|
458
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
459
|
+
...
|
|
460
|
+
|
|
461
|
+
@typing.overload
|
|
462
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
463
|
+
...
|
|
464
|
+
|
|
465
|
+
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):
|
|
466
|
+
"""
|
|
467
|
+
Specifies that the step will success under all circumstances.
|
|
468
|
+
|
|
469
|
+
The decorator will create an optional artifact, specified by `var`, which
|
|
470
|
+
contains the exception raised. You can use it to detect the presence
|
|
471
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
|
472
|
+
are missing.
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
Parameters
|
|
476
|
+
----------
|
|
477
|
+
var : str, optional, default None
|
|
478
|
+
Name of the artifact in which to store the caught exception.
|
|
479
|
+
If not specified, the exception is not stored.
|
|
480
|
+
print_exception : bool, default True
|
|
481
|
+
Determines whether or not the exception is printed to
|
|
482
|
+
stdout when caught.
|
|
483
|
+
"""
|
|
484
|
+
...
|
|
485
|
+
|
|
486
|
+
@typing.overload
|
|
487
|
+
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]]]:
|
|
488
|
+
"""
|
|
489
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
624
490
|
|
|
625
491
|
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
626
492
|
|
|
@@ -639,86 +505,227 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
|
639
505
|
...
|
|
640
506
|
|
|
641
507
|
@typing.overload
|
|
642
|
-
def
|
|
508
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
509
|
+
...
|
|
510
|
+
|
|
511
|
+
@typing.overload
|
|
512
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
513
|
+
...
|
|
514
|
+
|
|
515
|
+
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):
|
|
643
516
|
"""
|
|
644
|
-
|
|
517
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
|
645
518
|
|
|
646
|
-
|
|
647
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
|
648
|
-
you can use `@pypi_base` to set packages required by all
|
|
649
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
519
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
|
650
520
|
|
|
651
521
|
|
|
652
522
|
Parameters
|
|
653
523
|
----------
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
524
|
+
type : str, default 'default'
|
|
525
|
+
Card type.
|
|
526
|
+
id : str, optional, default None
|
|
527
|
+
If multiple cards are present, use this id to identify this card.
|
|
528
|
+
options : Dict[str, Any], default {}
|
|
529
|
+
Options passed to the card. The contents depend on the card type.
|
|
530
|
+
timeout : int, default 45
|
|
531
|
+
Interrupt reporting if it takes more than this many seconds.
|
|
660
532
|
"""
|
|
661
533
|
...
|
|
662
534
|
|
|
663
535
|
@typing.overload
|
|
664
|
-
def
|
|
536
|
+
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]]]:
|
|
537
|
+
"""
|
|
538
|
+
Specifies a timeout for your step.
|
|
539
|
+
|
|
540
|
+
This decorator is useful if this step may hang indefinitely.
|
|
541
|
+
|
|
542
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
543
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
544
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
545
|
+
|
|
546
|
+
Note that all the values specified in parameters are added together so if you specify
|
|
547
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
Parameters
|
|
551
|
+
----------
|
|
552
|
+
seconds : int, default 0
|
|
553
|
+
Number of seconds to wait prior to timing out.
|
|
554
|
+
minutes : int, default 0
|
|
555
|
+
Number of minutes to wait prior to timing out.
|
|
556
|
+
hours : int, default 0
|
|
557
|
+
Number of hours to wait prior to timing out.
|
|
558
|
+
"""
|
|
665
559
|
...
|
|
666
560
|
|
|
667
561
|
@typing.overload
|
|
668
|
-
def
|
|
562
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
669
563
|
...
|
|
670
564
|
|
|
671
|
-
|
|
565
|
+
@typing.overload
|
|
566
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
567
|
+
...
|
|
568
|
+
|
|
569
|
+
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):
|
|
672
570
|
"""
|
|
673
|
-
Specifies
|
|
571
|
+
Specifies a timeout for your step.
|
|
674
572
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
573
|
+
This decorator is useful if this step may hang indefinitely.
|
|
574
|
+
|
|
575
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
|
576
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
|
577
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
|
578
|
+
|
|
579
|
+
Note that all the values specified in parameters are added together so if you specify
|
|
580
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
|
679
581
|
|
|
680
582
|
|
|
681
583
|
Parameters
|
|
682
584
|
----------
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
585
|
+
seconds : int, default 0
|
|
586
|
+
Number of seconds to wait prior to timing out.
|
|
587
|
+
minutes : int, default 0
|
|
588
|
+
Number of minutes to wait prior to timing out.
|
|
589
|
+
hours : int, default 0
|
|
590
|
+
Number of hours to wait prior to timing out.
|
|
689
591
|
"""
|
|
690
592
|
...
|
|
691
593
|
|
|
692
594
|
@typing.overload
|
|
693
|
-
def
|
|
595
|
+
def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = 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]]]:
|
|
694
596
|
"""
|
|
695
|
-
Specifies
|
|
597
|
+
Specifies the resources needed when executing this step.
|
|
598
|
+
|
|
599
|
+
Use `@resources` to specify the resource requirements
|
|
600
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
601
|
+
|
|
602
|
+
You can choose the compute layer on the command line by executing e.g.
|
|
603
|
+
```
|
|
604
|
+
python myflow.py run --with batch
|
|
605
|
+
```
|
|
606
|
+
or
|
|
607
|
+
```
|
|
608
|
+
python myflow.py run --with kubernetes
|
|
609
|
+
```
|
|
610
|
+
which executes the flow on the desired system using the
|
|
611
|
+
requirements specified in `@resources`.
|
|
696
612
|
|
|
697
613
|
|
|
698
614
|
Parameters
|
|
699
615
|
----------
|
|
700
|
-
|
|
701
|
-
|
|
616
|
+
cpu : int, default 1
|
|
617
|
+
Number of CPUs required for this step.
|
|
618
|
+
gpu : int, optional, default None
|
|
619
|
+
Number of GPUs required for this step.
|
|
620
|
+
disk : int, optional, default None
|
|
621
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
622
|
+
memory : int, default 4096
|
|
623
|
+
Memory size (in MB) required for this step.
|
|
624
|
+
shared_memory : int, optional, default None
|
|
625
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
626
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
702
627
|
"""
|
|
703
628
|
...
|
|
704
629
|
|
|
705
630
|
@typing.overload
|
|
706
|
-
def
|
|
631
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
707
632
|
...
|
|
708
633
|
|
|
709
634
|
@typing.overload
|
|
710
|
-
def
|
|
635
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
711
636
|
...
|
|
712
637
|
|
|
713
|
-
def
|
|
638
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
|
714
639
|
"""
|
|
715
|
-
Specifies
|
|
640
|
+
Specifies the resources needed when executing this step.
|
|
641
|
+
|
|
642
|
+
Use `@resources` to specify the resource requirements
|
|
643
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
644
|
+
|
|
645
|
+
You can choose the compute layer on the command line by executing e.g.
|
|
646
|
+
```
|
|
647
|
+
python myflow.py run --with batch
|
|
648
|
+
```
|
|
649
|
+
or
|
|
650
|
+
```
|
|
651
|
+
python myflow.py run --with kubernetes
|
|
652
|
+
```
|
|
653
|
+
which executes the flow on the desired system using the
|
|
654
|
+
requirements specified in `@resources`.
|
|
716
655
|
|
|
717
656
|
|
|
718
657
|
Parameters
|
|
719
658
|
----------
|
|
720
|
-
|
|
721
|
-
|
|
659
|
+
cpu : int, default 1
|
|
660
|
+
Number of CPUs required for this step.
|
|
661
|
+
gpu : int, optional, default None
|
|
662
|
+
Number of GPUs required for this step.
|
|
663
|
+
disk : int, optional, default None
|
|
664
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
665
|
+
memory : int, default 4096
|
|
666
|
+
Memory size (in MB) required for this step.
|
|
667
|
+
shared_memory : int, optional, default None
|
|
668
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
669
|
+
This parameter maps to the `--shm-size` option in Docker.
|
|
670
|
+
"""
|
|
671
|
+
...
|
|
672
|
+
|
|
673
|
+
@typing.overload
|
|
674
|
+
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]]]:
|
|
675
|
+
"""
|
|
676
|
+
Specifies the Conda environment for the step.
|
|
677
|
+
|
|
678
|
+
Information in this decorator will augment any
|
|
679
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
680
|
+
you can use `@conda_base` to set packages required by all
|
|
681
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
Parameters
|
|
685
|
+
----------
|
|
686
|
+
packages : Dict[str, str], default {}
|
|
687
|
+
Packages to use for this step. The key is the name of the package
|
|
688
|
+
and the value is the version to use.
|
|
689
|
+
libraries : Dict[str, str], default {}
|
|
690
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
691
|
+
python : str, optional, default None
|
|
692
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
693
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
694
|
+
disabled : bool, default False
|
|
695
|
+
If set to True, disables @conda.
|
|
696
|
+
"""
|
|
697
|
+
...
|
|
698
|
+
|
|
699
|
+
@typing.overload
|
|
700
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
701
|
+
...
|
|
702
|
+
|
|
703
|
+
@typing.overload
|
|
704
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
705
|
+
...
|
|
706
|
+
|
|
707
|
+
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):
|
|
708
|
+
"""
|
|
709
|
+
Specifies the Conda environment for the step.
|
|
710
|
+
|
|
711
|
+
Information in this decorator will augment any
|
|
712
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
|
713
|
+
you can use `@conda_base` to set packages required by all
|
|
714
|
+
steps and use `@conda` to specify step-specific overrides.
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
Parameters
|
|
718
|
+
----------
|
|
719
|
+
packages : Dict[str, str], default {}
|
|
720
|
+
Packages to use for this step. The key is the name of the package
|
|
721
|
+
and the value is the version to use.
|
|
722
|
+
libraries : Dict[str, str], default {}
|
|
723
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
|
724
|
+
python : str, optional, default None
|
|
725
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
726
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
727
|
+
disabled : bool, default False
|
|
728
|
+
If set to True, disables @conda.
|
|
722
729
|
"""
|
|
723
730
|
...
|
|
724
731
|
|
|
@@ -812,81 +819,74 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
|
812
819
|
...
|
|
813
820
|
|
|
814
821
|
@typing.overload
|
|
815
|
-
def
|
|
822
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: 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]]]:
|
|
816
823
|
"""
|
|
817
|
-
Specifies
|
|
818
|
-
|
|
819
|
-
Use `@resources` to specify the resource requirements
|
|
820
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
821
|
-
|
|
822
|
-
You can choose the compute layer on the command line by executing e.g.
|
|
823
|
-
```
|
|
824
|
-
python myflow.py run --with batch
|
|
825
|
-
```
|
|
826
|
-
or
|
|
827
|
-
```
|
|
828
|
-
python myflow.py run --with kubernetes
|
|
829
|
-
```
|
|
830
|
-
which executes the flow on the desired system using the
|
|
831
|
-
requirements specified in `@resources`.
|
|
824
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
825
|
+
the execution of a step.
|
|
832
826
|
|
|
833
827
|
|
|
834
828
|
Parameters
|
|
835
829
|
----------
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
disk : int, optional, default None
|
|
841
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
|
842
|
-
memory : int, default 4096
|
|
843
|
-
Memory size (in MB) required for this step.
|
|
844
|
-
shared_memory : int, optional, default None
|
|
845
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
|
846
|
-
This parameter maps to the `--shm-size` option in Docker.
|
|
830
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
831
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
832
|
+
role : str, optional, default: None
|
|
833
|
+
Role to use for fetching secrets
|
|
847
834
|
"""
|
|
848
835
|
...
|
|
849
836
|
|
|
850
837
|
@typing.overload
|
|
851
|
-
def
|
|
838
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
852
839
|
...
|
|
853
840
|
|
|
854
841
|
@typing.overload
|
|
855
|
-
def
|
|
842
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
856
843
|
...
|
|
857
844
|
|
|
858
|
-
def
|
|
845
|
+
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]]] = [], role: typing.Optional[str] = None):
|
|
859
846
|
"""
|
|
860
|
-
Specifies
|
|
847
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
|
848
|
+
the execution of a step.
|
|
861
849
|
|
|
862
|
-
Use `@resources` to specify the resource requirements
|
|
863
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
|
864
850
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
851
|
+
Parameters
|
|
852
|
+
----------
|
|
853
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
|
854
|
+
List of secret specs, defining how the secrets are to be retrieved
|
|
855
|
+
role : str, optional, default: None
|
|
856
|
+
Role to use for fetching secrets
|
|
857
|
+
"""
|
|
858
|
+
...
|
|
859
|
+
|
|
860
|
+
@typing.overload
|
|
861
|
+
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]]]:
|
|
862
|
+
"""
|
|
863
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
875
864
|
|
|
876
865
|
|
|
877
866
|
Parameters
|
|
878
867
|
----------
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
868
|
+
vars : Dict[str, str], default {}
|
|
869
|
+
Dictionary of environment variables to set.
|
|
870
|
+
"""
|
|
871
|
+
...
|
|
872
|
+
|
|
873
|
+
@typing.overload
|
|
874
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
|
875
|
+
...
|
|
876
|
+
|
|
877
|
+
@typing.overload
|
|
878
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
|
879
|
+
...
|
|
880
|
+
|
|
881
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
|
882
|
+
"""
|
|
883
|
+
Specifies environment variables to be set prior to the execution of a step.
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
Parameters
|
|
887
|
+
----------
|
|
888
|
+
vars : Dict[str, str], default {}
|
|
889
|
+
Dictionary of environment variables to set.
|
|
890
890
|
"""
|
|
891
891
|
...
|
|
892
892
|
|
|
@@ -991,6 +991,47 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
|
991
991
|
"""
|
|
992
992
|
...
|
|
993
993
|
|
|
994
|
+
@typing.overload
|
|
995
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
996
|
+
"""
|
|
997
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
998
|
+
|
|
999
|
+
Use `@pypi_base` to set common packages required by all
|
|
1000
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1001
|
+
|
|
1002
|
+
Parameters
|
|
1003
|
+
----------
|
|
1004
|
+
packages : Dict[str, str], default: {}
|
|
1005
|
+
Packages to use for this flow. The key is the name of the package
|
|
1006
|
+
and the value is the version to use.
|
|
1007
|
+
python : str, optional, default: None
|
|
1008
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1009
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1010
|
+
"""
|
|
1011
|
+
...
|
|
1012
|
+
|
|
1013
|
+
@typing.overload
|
|
1014
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1015
|
+
...
|
|
1016
|
+
|
|
1017
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
1018
|
+
"""
|
|
1019
|
+
Specifies the PyPI packages for all steps of the flow.
|
|
1020
|
+
|
|
1021
|
+
Use `@pypi_base` to set common packages required by all
|
|
1022
|
+
steps and use `@pypi` to specify step-specific overrides.
|
|
1023
|
+
|
|
1024
|
+
Parameters
|
|
1025
|
+
----------
|
|
1026
|
+
packages : Dict[str, str], default: {}
|
|
1027
|
+
Packages to use for this flow. The key is the name of the package
|
|
1028
|
+
and the value is the version to use.
|
|
1029
|
+
python : str, optional, default: None
|
|
1030
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1031
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1032
|
+
"""
|
|
1033
|
+
...
|
|
1034
|
+
|
|
994
1035
|
@typing.overload
|
|
995
1036
|
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]]:
|
|
996
1037
|
"""
|
|
@@ -1042,49 +1083,6 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
|
1042
1083
|
"""
|
|
1043
1084
|
...
|
|
1044
1085
|
|
|
1045
|
-
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]]:
|
|
1046
|
-
"""
|
|
1047
|
-
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)
|
|
1048
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
|
1049
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1050
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1051
|
-
starts only after all sensors finish.
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
Parameters
|
|
1055
|
-
----------
|
|
1056
|
-
timeout : int
|
|
1057
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1058
|
-
poke_interval : int
|
|
1059
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1060
|
-
mode : str
|
|
1061
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1062
|
-
exponential_backoff : bool
|
|
1063
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1064
|
-
pool : str
|
|
1065
|
-
the slot pool this task should run in,
|
|
1066
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1067
|
-
soft_fail : bool
|
|
1068
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1069
|
-
name : str
|
|
1070
|
-
Name of the sensor on Airflow
|
|
1071
|
-
description : str
|
|
1072
|
-
Description of sensor in the Airflow UI
|
|
1073
|
-
bucket_key : Union[str, List[str]]
|
|
1074
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
1075
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
1076
|
-
bucket_name : str
|
|
1077
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
1078
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
1079
|
-
wildcard_match : bool
|
|
1080
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
1081
|
-
aws_conn_id : str
|
|
1082
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
|
1083
|
-
verify : bool
|
|
1084
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
1085
|
-
"""
|
|
1086
|
-
...
|
|
1087
|
-
|
|
1088
1086
|
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1089
1087
|
"""
|
|
1090
1088
|
Specifies what flows belong to the same project.
|
|
@@ -1120,6 +1118,49 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
|
|
|
1120
1118
|
"""
|
|
1121
1119
|
...
|
|
1122
1120
|
|
|
1121
|
+
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]]:
|
|
1122
|
+
"""
|
|
1123
|
+
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.
|
|
1124
|
+
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.
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
Parameters
|
|
1128
|
+
----------
|
|
1129
|
+
timeout : int
|
|
1130
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1131
|
+
poke_interval : int
|
|
1132
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1133
|
+
mode : str
|
|
1134
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1135
|
+
exponential_backoff : bool
|
|
1136
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1137
|
+
pool : str
|
|
1138
|
+
the slot pool this task should run in,
|
|
1139
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1140
|
+
soft_fail : bool
|
|
1141
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1142
|
+
name : str
|
|
1143
|
+
Name of the sensor on Airflow
|
|
1144
|
+
description : str
|
|
1145
|
+
Description of sensor in the Airflow UI
|
|
1146
|
+
external_dag_id : str
|
|
1147
|
+
The dag_id that contains the task you want to wait for.
|
|
1148
|
+
external_task_ids : List[str]
|
|
1149
|
+
The list of task_ids that you want to wait for.
|
|
1150
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
|
1151
|
+
allowed_states : List[str]
|
|
1152
|
+
Iterable of allowed states, (Default: ['success'])
|
|
1153
|
+
failed_states : List[str]
|
|
1154
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
|
1155
|
+
execution_delta : datetime.timedelta
|
|
1156
|
+
time difference with the previous execution to look at,
|
|
1157
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
|
1158
|
+
check_existence: bool
|
|
1159
|
+
Set to True to check if the external task exists or check if
|
|
1160
|
+
the DAG to wait for exists. (Default: True)
|
|
1161
|
+
"""
|
|
1162
|
+
...
|
|
1163
|
+
|
|
1123
1164
|
@typing.overload
|
|
1124
1165
|
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]]:
|
|
1125
1166
|
"""
|
|
@@ -1213,90 +1254,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
|
1213
1254
|
"""
|
|
1214
1255
|
...
|
|
1215
1256
|
|
|
1216
|
-
@typing.overload
|
|
1217
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
|
1218
|
-
"""
|
|
1219
|
-
Specifies the PyPI packages for all steps of the flow.
|
|
1220
|
-
|
|
1221
|
-
Use `@pypi_base` to set common packages required by all
|
|
1222
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1223
|
-
|
|
1224
|
-
Parameters
|
|
1225
|
-
----------
|
|
1226
|
-
packages : Dict[str, str], default: {}
|
|
1227
|
-
Packages to use for this flow. The key is the name of the package
|
|
1228
|
-
and the value is the version to use.
|
|
1229
|
-
python : str, optional, default: None
|
|
1230
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1231
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1232
|
-
"""
|
|
1233
|
-
...
|
|
1234
|
-
|
|
1235
|
-
@typing.overload
|
|
1236
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
|
1237
|
-
...
|
|
1238
|
-
|
|
1239
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
|
1240
|
-
"""
|
|
1241
|
-
Specifies the PyPI packages for all steps of the flow.
|
|
1242
|
-
|
|
1243
|
-
Use `@pypi_base` to set common packages required by all
|
|
1244
|
-
steps and use `@pypi` to specify step-specific overrides.
|
|
1245
|
-
|
|
1246
|
-
Parameters
|
|
1247
|
-
----------
|
|
1248
|
-
packages : Dict[str, str], default: {}
|
|
1249
|
-
Packages to use for this flow. The key is the name of the package
|
|
1250
|
-
and the value is the version to use.
|
|
1251
|
-
python : str, optional, default: None
|
|
1252
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
|
1253
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
|
1254
|
-
"""
|
|
1255
|
-
...
|
|
1256
|
-
|
|
1257
|
-
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]]:
|
|
1258
|
-
"""
|
|
1259
|
-
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.
|
|
1260
|
-
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.
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
Parameters
|
|
1264
|
-
----------
|
|
1265
|
-
timeout : int
|
|
1266
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1267
|
-
poke_interval : int
|
|
1268
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1269
|
-
mode : str
|
|
1270
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1271
|
-
exponential_backoff : bool
|
|
1272
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1273
|
-
pool : str
|
|
1274
|
-
the slot pool this task should run in,
|
|
1275
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1276
|
-
soft_fail : bool
|
|
1277
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1278
|
-
name : str
|
|
1279
|
-
Name of the sensor on Airflow
|
|
1280
|
-
description : str
|
|
1281
|
-
Description of sensor in the Airflow UI
|
|
1282
|
-
external_dag_id : str
|
|
1283
|
-
The dag_id that contains the task you want to wait for.
|
|
1284
|
-
external_task_ids : List[str]
|
|
1285
|
-
The list of task_ids that you want to wait for.
|
|
1286
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
|
1287
|
-
allowed_states : List[str]
|
|
1288
|
-
Iterable of allowed states, (Default: ['success'])
|
|
1289
|
-
failed_states : List[str]
|
|
1290
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
|
1291
|
-
execution_delta : datetime.timedelta
|
|
1292
|
-
time difference with the previous execution to look at,
|
|
1293
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
|
1294
|
-
check_existence: bool
|
|
1295
|
-
Set to True to check if the external task exists or check if
|
|
1296
|
-
the DAG to wait for exists. (Default: True)
|
|
1297
|
-
"""
|
|
1298
|
-
...
|
|
1299
|
-
|
|
1300
1257
|
@typing.overload
|
|
1301
1258
|
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]]:
|
|
1302
1259
|
"""
|
|
@@ -1348,3 +1305,46 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
|
1348
1305
|
"""
|
|
1349
1306
|
...
|
|
1350
1307
|
|
|
1308
|
+
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]]:
|
|
1309
|
+
"""
|
|
1310
|
+
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)
|
|
1311
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
|
1312
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
|
1313
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
|
1314
|
+
starts only after all sensors finish.
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
Parameters
|
|
1318
|
+
----------
|
|
1319
|
+
timeout : int
|
|
1320
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
|
1321
|
+
poke_interval : int
|
|
1322
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
|
1323
|
+
mode : str
|
|
1324
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
|
1325
|
+
exponential_backoff : bool
|
|
1326
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
|
1327
|
+
pool : str
|
|
1328
|
+
the slot pool this task should run in,
|
|
1329
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
|
1330
|
+
soft_fail : bool
|
|
1331
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
|
1332
|
+
name : str
|
|
1333
|
+
Name of the sensor on Airflow
|
|
1334
|
+
description : str
|
|
1335
|
+
Description of sensor in the Airflow UI
|
|
1336
|
+
bucket_key : Union[str, List[str]]
|
|
1337
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
|
1338
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
|
1339
|
+
bucket_name : str
|
|
1340
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
|
1341
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
|
1342
|
+
wildcard_match : bool
|
|
1343
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
|
1344
|
+
aws_conn_id : str
|
|
1345
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
|
1346
|
+
verify : bool
|
|
1347
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
|
1348
|
+
"""
|
|
1349
|
+
...
|
|
1350
|
+
|