ob-metaflow-stubs 6.0.3.102rc6__py2.py3-none-any.whl → 6.0.3.102rc8__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. metaflow-stubs/__init__.pyi +607 -607
  2. metaflow-stubs/cards.pyi +3 -3
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +6 -6
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +1 -1
  8. metaflow-stubs/events.pyi +1 -1
  9. metaflow-stubs/exception.pyi +1 -1
  10. metaflow-stubs/flowspec.pyi +5 -5
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +4 -4
  13. metaflow-stubs/info_file.pyi +1 -1
  14. metaflow-stubs/metadata/metadata.pyi +1 -1
  15. metaflow-stubs/metadata/util.pyi +1 -1
  16. metaflow-stubs/metaflow_config.pyi +1 -1
  17. metaflow-stubs/metaflow_current.pyi +65 -65
  18. metaflow-stubs/mflog/mflog.pyi +1 -1
  19. metaflow-stubs/multicore_utils.pyi +1 -1
  20. metaflow-stubs/parameters.pyi +3 -3
  21. metaflow-stubs/plugins/__init__.pyi +1 -1
  22. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  23. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  24. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  25. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  26. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  29. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  30. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  31. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  32. metaflow-stubs/plugins/argo/argo_workflows.pyi +5 -5
  33. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +6 -6
  34. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +5 -5
  35. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
  36. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  37. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  38. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  39. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  40. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  41. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  42. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  43. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  44. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
  45. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  46. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  47. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +1 -1
  48. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  49. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  50. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  51. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  52. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  53. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  54. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  55. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +2 -2
  56. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  57. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  58. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  59. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  60. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  61. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  62. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  63. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  64. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  66. metaflow-stubs/plugins/cards/card_modules/basic.pyi +1 -1
  67. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  68. metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  70. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  71. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
  72. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  73. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  74. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  75. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  76. metaflow-stubs/plugins/datatools/__init__.pyi +1 -1
  77. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  78. metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
  79. metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -6
  80. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  81. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  82. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  83. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  84. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  85. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  86. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  87. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  88. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  89. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
  90. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  91. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  92. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  93. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  94. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  95. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +1 -1
  96. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  97. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +2 -2
  98. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  99. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  100. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
  101. metaflow-stubs/plugins/logs_cli.pyi +2 -2
  102. metaflow-stubs/plugins/package_cli.pyi +1 -1
  103. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  104. metaflow-stubs/plugins/perimeters.pyi +1 -1
  105. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  106. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  107. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  108. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  109. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  110. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  111. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  112. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  113. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  114. metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
  115. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +1 -1
  116. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  117. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  118. metaflow-stubs/plugins/tag_cli.pyi +4 -4
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
  120. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  121. metaflow-stubs/procpoll.pyi +1 -1
  122. metaflow-stubs/profilers/__init__.pyi +1 -1
  123. metaflow-stubs/pylint_wrapper.pyi +1 -1
  124. metaflow-stubs/runner/__init__.pyi +1 -1
  125. metaflow-stubs/runner/deployer.pyi +1 -1
  126. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  127. metaflow-stubs/runner/nbdeploy.pyi +1 -1
  128. metaflow-stubs/runner/nbrun.pyi +1 -1
  129. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  130. metaflow-stubs/runner/utils.pyi +1 -1
  131. metaflow-stubs/system/__init__.pyi +2 -2
  132. metaflow-stubs/system/system_logger.pyi +2 -2
  133. metaflow-stubs/system/system_monitor.pyi +1 -1
  134. metaflow-stubs/tagging_util.pyi +1 -1
  135. metaflow-stubs/tuple_util.pyi +1 -1
  136. {ob_metaflow_stubs-6.0.3.102rc6.dist-info → ob_metaflow_stubs-6.0.3.102rc8.dist-info}/METADATA +1 -1
  137. ob_metaflow_stubs-6.0.3.102rc8.dist-info/RECORD +140 -0
  138. ob_metaflow_stubs-6.0.3.102rc6.dist-info/RECORD +0 -140
  139. {ob_metaflow_stubs-6.0.3.102rc6.dist-info → ob_metaflow_stubs-6.0.3.102rc8.dist-info}/WHEEL +0 -0
  140. {ob_metaflow_stubs-6.0.3.102rc6.dist-info → ob_metaflow_stubs-6.0.3.102rc8.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,24 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.22.1+obcheckpoint(0.0.10);ob(v1) #
4
- # Generated on 2024-09-20T19:23:06.789979 #
4
+ # Generated on 2024-09-20T19:35:46.753101 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import datetime
12
- import metaflow.parameters
13
- import metaflow.events
14
- import metaflow._vendor.click.types
15
- import typing
16
11
  import metaflow.client.core
17
- import metaflow.datastore.inputs
18
- import metaflow.flowspec
19
- import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
20
12
  import metaflow.metaflow_current
13
+ import typing
14
+ import metaflow.flowspec
15
+ import datetime
21
16
  import metaflow.runner.metaflow_runner
17
+ import metaflow.datastore.inputs
18
+ import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
19
+ import metaflow._vendor.click.types
20
+ import metaflow.parameters
21
+ import metaflow.events
22
22
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
23
23
  StepFlag = typing.NewType("StepFlag", bool)
24
24
 
@@ -435,274 +435,261 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
435
435
  ...
436
436
 
437
437
  @typing.overload
438
- 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]]]:
438
+ 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]]]:
439
439
  """
440
- Specifies a timeout for your step.
441
-
442
- This decorator is useful if this step may hang indefinitely.
443
-
444
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
445
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
446
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
440
+ Enables loading / saving of models within a step.
447
441
 
448
- Note that all the values specified in parameters are added together so if you specify
449
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
450
442
 
451
443
  Parameters
452
444
  ----------
453
- seconds : int, default 0
454
- Number of seconds to wait prior to timing out.
455
- minutes : int, default 0
456
- Number of minutes to wait prior to timing out.
457
- hours : int, default 0
458
- Number of hours to wait prior to timing out.
445
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
446
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
447
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
448
+ - `current.checkpoint`
449
+ - `current.model`
450
+ - `current.huggingface_hub`
451
+
452
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
453
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
454
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
455
+
456
+ temp_dir_root : str, default: None
457
+ The root directory under which `current.model.loaded` will store loaded models
458
+
459
+
460
+
459
461
  """
460
462
  ...
461
463
 
462
464
  @typing.overload
463
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
465
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
464
466
  ...
465
467
 
466
468
  @typing.overload
467
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
469
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
468
470
  ...
469
471
 
470
- 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):
472
+ 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):
471
473
  """
472
- Specifies a timeout for your step.
473
-
474
- This decorator is useful if this step may hang indefinitely.
475
-
476
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
477
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
478
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
474
+ Enables loading / saving of models within a step.
479
475
 
480
- Note that all the values specified in parameters are added together so if you specify
481
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
482
476
 
483
477
  Parameters
484
478
  ----------
485
- seconds : int, default 0
486
- Number of seconds to wait prior to timing out.
487
- minutes : int, default 0
488
- Number of minutes to wait prior to timing out.
489
- hours : int, default 0
490
- Number of hours to wait prior to timing out.
479
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
480
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
481
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
482
+ - `current.checkpoint`
483
+ - `current.model`
484
+ - `current.huggingface_hub`
485
+
486
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
487
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
488
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
489
+
490
+ temp_dir_root : str, default: None
491
+ The root directory under which `current.model.loaded` will store loaded models
492
+
493
+
494
+
491
495
  """
492
496
  ...
493
497
 
494
498
  @typing.overload
495
- 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]]]:
499
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
496
500
  """
497
- Specifies secrets to be retrieved and injected as environment variables prior to
498
- the execution of a step.
499
-
500
- Parameters
501
- ----------
502
- sources : List[Union[str, Dict[str, Any]]], default: []
503
- List of secret specs, defining how the secrets are to be retrieved
501
+ Decorator prototype for all step decorators. This function gets specialized
502
+ and imported for all decorators types by _import_plugin_decorators().
504
503
  """
505
504
  ...
506
505
 
507
506
  @typing.overload
508
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
509
- ...
510
-
511
- @typing.overload
512
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
507
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
513
508
  ...
514
509
 
515
- 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]]] = []):
510
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
516
511
  """
517
- Specifies secrets to be retrieved and injected as environment variables prior to
518
- the execution of a step.
519
-
520
- Parameters
521
- ----------
522
- sources : List[Union[str, Dict[str, Any]]], default: []
523
- List of secret specs, defining how the secrets are to be retrieved
512
+ Decorator prototype for all step decorators. This function gets specialized
513
+ and imported for all decorators types by _import_plugin_decorators().
524
514
  """
525
515
  ...
526
516
 
527
517
  @typing.overload
528
- 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]]]:
518
+ 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]]]:
529
519
  """
530
- Specifies the Conda environment for the step.
520
+ Specifies the number of times the task corresponding
521
+ to a step needs to be retried.
531
522
 
532
- Information in this decorator will augment any
533
- attributes set in the `@conda_base` flow-level decorator. Hence,
534
- you can use `@conda_base` to set packages required by all
535
- steps and use `@conda` to specify step-specific overrides.
523
+ This decorator is useful for handling transient errors, such as networking issues.
524
+ If your task contains operations that can't be retried safely, e.g. database updates,
525
+ it is advisable to annotate it with `@retry(times=0)`.
526
+
527
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
528
+ decorator will execute a no-op task after all retries have been exhausted,
529
+ ensuring that the flow execution can continue.
536
530
 
537
531
  Parameters
538
532
  ----------
539
- packages : Dict[str, str], default {}
540
- Packages to use for this step. The key is the name of the package
541
- and the value is the version to use.
542
- libraries : Dict[str, str], default {}
543
- Supported for backward compatibility. When used with packages, packages will take precedence.
544
- python : str, optional, default None
545
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
546
- that the version used will correspond to the version of the Python interpreter used to start the run.
547
- disabled : bool, default False
548
- If set to True, disables @conda.
533
+ times : int, default 3
534
+ Number of times to retry this task.
535
+ minutes_between_retries : int, default 2
536
+ Number of minutes between retries.
549
537
  """
550
538
  ...
551
539
 
552
540
  @typing.overload
553
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
541
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
554
542
  ...
555
543
 
556
544
  @typing.overload
557
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
545
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
558
546
  ...
559
547
 
560
- 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):
548
+ 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):
561
549
  """
562
- Specifies the Conda environment for the step.
550
+ Specifies the number of times the task corresponding
551
+ to a step needs to be retried.
563
552
 
564
- Information in this decorator will augment any
565
- attributes set in the `@conda_base` flow-level decorator. Hence,
566
- you can use `@conda_base` to set packages required by all
567
- steps and use `@conda` to specify step-specific overrides.
553
+ This decorator is useful for handling transient errors, such as networking issues.
554
+ If your task contains operations that can't be retried safely, e.g. database updates,
555
+ it is advisable to annotate it with `@retry(times=0)`.
556
+
557
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
558
+ decorator will execute a no-op task after all retries have been exhausted,
559
+ ensuring that the flow execution can continue.
568
560
 
569
561
  Parameters
570
562
  ----------
571
- packages : Dict[str, str], default {}
572
- Packages to use for this step. The key is the name of the package
573
- and the value is the version to use.
574
- libraries : Dict[str, str], default {}
575
- Supported for backward compatibility. When used with packages, packages will take precedence.
576
- python : str, optional, default None
577
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
578
- that the version used will correspond to the version of the Python interpreter used to start the run.
579
- disabled : bool, default False
580
- If set to True, disables @conda.
563
+ times : int, default 3
564
+ Number of times to retry this task.
565
+ minutes_between_retries : int, default 2
566
+ Number of minutes between retries.
581
567
  """
582
568
  ...
583
569
 
584
570
  @typing.overload
585
- 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]]]:
571
+ def resources(*, cpu: int = 1, gpu: int = 0, 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]]]:
586
572
  """
587
- Specifies that the step will success under all circumstances.
573
+ Specifies the resources needed when executing this step.
588
574
 
589
- The decorator will create an optional artifact, specified by `var`, which
590
- contains the exception raised. You can use it to detect the presence
591
- of errors, indicating that all happy-path artifacts produced by the step
592
- are missing.
575
+ Use `@resources` to specify the resource requirements
576
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
577
+
578
+ You can choose the compute layer on the command line by executing e.g.
579
+ ```
580
+ python myflow.py run --with batch
581
+ ```
582
+ or
583
+ ```
584
+ python myflow.py run --with kubernetes
585
+ ```
586
+ which executes the flow on the desired system using the
587
+ requirements specified in `@resources`.
593
588
 
594
589
  Parameters
595
590
  ----------
596
- var : str, optional, default None
597
- Name of the artifact in which to store the caught exception.
598
- If not specified, the exception is not stored.
599
- print_exception : bool, default True
600
- Determines whether or not the exception is printed to
601
- stdout when caught.
591
+ cpu : int, default 1
592
+ Number of CPUs required for this step.
593
+ gpu : int, default 0
594
+ Number of GPUs required for this step.
595
+ disk : int, optional, default None
596
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
597
+ memory : int, default 4096
598
+ Memory size (in MB) required for this step.
599
+ shared_memory : int, optional, default None
600
+ The value for the size (in MiB) of the /dev/shm volume for this step.
601
+ This parameter maps to the `--shm-size` option in Docker.
602
602
  """
603
603
  ...
604
604
 
605
605
  @typing.overload
606
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
606
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
607
607
  ...
608
608
 
609
609
  @typing.overload
610
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
610
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
611
611
  ...
612
612
 
613
- 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):
613
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
614
614
  """
615
- Specifies that the step will success under all circumstances.
615
+ Specifies the resources needed when executing this step.
616
616
 
617
- The decorator will create an optional artifact, specified by `var`, which
618
- contains the exception raised. You can use it to detect the presence
619
- of errors, indicating that all happy-path artifacts produced by the step
620
- are missing.
617
+ Use `@resources` to specify the resource requirements
618
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
619
+
620
+ You can choose the compute layer on the command line by executing e.g.
621
+ ```
622
+ python myflow.py run --with batch
623
+ ```
624
+ or
625
+ ```
626
+ python myflow.py run --with kubernetes
627
+ ```
628
+ which executes the flow on the desired system using the
629
+ requirements specified in `@resources`.
621
630
 
622
631
  Parameters
623
632
  ----------
624
- var : str, optional, default None
625
- Name of the artifact in which to store the caught exception.
626
- If not specified, the exception is not stored.
627
- print_exception : bool, default True
628
- Determines whether or not the exception is printed to
629
- stdout when caught.
630
- """
631
- ...
632
-
633
- @typing.overload
634
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
635
- """
636
- Internal decorator to support Fast bakery
637
- """
638
- ...
639
-
640
- @typing.overload
641
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
642
- ...
643
-
644
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
645
- """
646
- Internal decorator to support Fast bakery
633
+ cpu : int, default 1
634
+ Number of CPUs required for this step.
635
+ gpu : int, default 0
636
+ Number of GPUs required for this step.
637
+ disk : int, optional, default None
638
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
639
+ memory : int, default 4096
640
+ Memory size (in MB) required for this step.
641
+ shared_memory : int, optional, default None
642
+ The value for the size (in MiB) of the /dev/shm volume for this step.
643
+ This parameter maps to the `--shm-size` option in Docker.
647
644
  """
648
645
  ...
649
646
 
650
647
  @typing.overload
651
- 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]]]:
648
+ 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]]]:
652
649
  """
653
- Enables loading / saving of models within a step.
650
+ Creates a human-readable report, a Metaflow Card, after this step completes.
654
651
 
652
+ Note that you may add multiple `@card` decorators in a step with different parameters.
655
653
 
656
654
  Parameters
657
655
  ----------
658
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
659
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
660
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
661
- - `current.checkpoint`
662
- - `current.model`
663
- - `current.huggingface_hub`
664
-
665
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
666
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
667
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
668
-
669
- temp_dir_root : str, default: None
670
- The root directory under which `current.model.loaded` will store loaded models
671
-
656
+ type : str, default 'default'
657
+ Card type.
658
+ id : str, optional, default None
659
+ If multiple cards are present, use this id to identify this card.
660
+ options : Dict[str, Any], default {}
661
+ Options passed to the card. The contents depend on the card type.
662
+ timeout : int, default 45
663
+ Interrupt reporting if it takes more than this many seconds.
672
664
 
673
665
 
674
666
  """
675
667
  ...
676
668
 
677
669
  @typing.overload
678
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
670
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
679
671
  ...
680
672
 
681
673
  @typing.overload
682
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
674
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
683
675
  ...
684
676
 
685
- 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):
677
+ 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):
686
678
  """
687
- Enables loading / saving of models within a step.
679
+ Creates a human-readable report, a Metaflow Card, after this step completes.
688
680
 
681
+ Note that you may add multiple `@card` decorators in a step with different parameters.
689
682
 
690
683
  Parameters
691
684
  ----------
692
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
693
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
694
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
695
- - `current.checkpoint`
696
- - `current.model`
697
- - `current.huggingface_hub`
698
-
699
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
700
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
701
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
702
-
703
- temp_dir_root : str, default: None
704
- The root directory under which `current.model.loaded` will store loaded models
705
-
685
+ type : str, default 'default'
686
+ Card type.
687
+ id : str, optional, default None
688
+ If multiple cards are present, use this id to identify this card.
689
+ options : Dict[str, Any], default {}
690
+ Options passed to the card. The contents depend on the card type.
691
+ timeout : int, default 45
692
+ Interrupt reporting if it takes more than this many seconds.
706
693
 
707
694
 
708
695
  """
@@ -740,51 +727,116 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
740
727
  ...
741
728
 
742
729
  @typing.overload
743
- 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]]]:
730
+ 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]]]:
744
731
  """
745
- Specifies the PyPI packages for the step.
732
+ Specifies a timeout for your step.
733
+
734
+ This decorator is useful if this step may hang indefinitely.
735
+
736
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
737
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
738
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
739
+
740
+ Note that all the values specified in parameters are added together so if you specify
741
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
742
+
743
+ Parameters
744
+ ----------
745
+ seconds : int, default 0
746
+ Number of seconds to wait prior to timing out.
747
+ minutes : int, default 0
748
+ Number of minutes to wait prior to timing out.
749
+ hours : int, default 0
750
+ Number of hours to wait prior to timing out.
751
+ """
752
+ ...
753
+
754
+ @typing.overload
755
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
756
+ ...
757
+
758
+ @typing.overload
759
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
760
+ ...
761
+
762
+ 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):
763
+ """
764
+ Specifies a timeout for your step.
765
+
766
+ This decorator is useful if this step may hang indefinitely.
767
+
768
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
769
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
770
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
771
+
772
+ Note that all the values specified in parameters are added together so if you specify
773
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
774
+
775
+ Parameters
776
+ ----------
777
+ seconds : int, default 0
778
+ Number of seconds to wait prior to timing out.
779
+ minutes : int, default 0
780
+ Number of minutes to wait prior to timing out.
781
+ hours : int, default 0
782
+ Number of hours to wait prior to timing out.
783
+ """
784
+ ...
785
+
786
+ @typing.overload
787
+ 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]]]:
788
+ """
789
+ Specifies the Conda environment for the step.
746
790
 
747
791
  Information in this decorator will augment any
748
- attributes set in the `@pyi_base` flow-level decorator. Hence,
749
- you can use `@pypi_base` to set packages required by all
750
- steps and use `@pypi` to specify step-specific overrides.
792
+ attributes set in the `@conda_base` flow-level decorator. Hence,
793
+ you can use `@conda_base` to set packages required by all
794
+ steps and use `@conda` to specify step-specific overrides.
751
795
 
752
796
  Parameters
753
797
  ----------
754
- packages : Dict[str, str], default: {}
798
+ packages : Dict[str, str], default {}
755
799
  Packages to use for this step. The key is the name of the package
756
800
  and the value is the version to use.
757
- python : str, optional, default: None
801
+ libraries : Dict[str, str], default {}
802
+ Supported for backward compatibility. When used with packages, packages will take precedence.
803
+ python : str, optional, default None
758
804
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
759
805
  that the version used will correspond to the version of the Python interpreter used to start the run.
806
+ disabled : bool, default False
807
+ If set to True, disables @conda.
760
808
  """
761
809
  ...
762
810
 
763
811
  @typing.overload
764
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
812
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
765
813
  ...
766
814
 
767
815
  @typing.overload
768
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
816
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
769
817
  ...
770
818
 
771
- 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):
819
+ 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):
772
820
  """
773
- Specifies the PyPI packages for the step.
821
+ Specifies the Conda environment for the step.
774
822
 
775
823
  Information in this decorator will augment any
776
- attributes set in the `@pyi_base` flow-level decorator. Hence,
777
- you can use `@pypi_base` to set packages required by all
778
- steps and use `@pypi` to specify step-specific overrides.
824
+ attributes set in the `@conda_base` flow-level decorator. Hence,
825
+ you can use `@conda_base` to set packages required by all
826
+ steps and use `@conda` to specify step-specific overrides.
779
827
 
780
828
  Parameters
781
829
  ----------
782
- packages : Dict[str, str], default: {}
830
+ packages : Dict[str, str], default {}
783
831
  Packages to use for this step. The key is the name of the package
784
832
  and the value is the version to use.
785
- python : str, optional, default: None
833
+ libraries : Dict[str, str], default {}
834
+ Supported for backward compatibility. When used with packages, packages will take precedence.
835
+ python : str, optional, default None
786
836
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
787
837
  that the version used will correspond to the version of the Python interpreter used to start the run.
838
+ disabled : bool, default False
839
+ If set to True, disables @conda.
788
840
  """
789
841
  ...
790
842
 
@@ -855,446 +907,295 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
855
907
  ...
856
908
 
857
909
  @typing.overload
858
- def checkpoint(*, load_policy: str = "fresh", temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
910
+ 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]]]:
859
911
  """
860
- Enables checkpointing for a step.
912
+ Specifies the PyPI packages for the step.
861
913
 
914
+ Information in this decorator will augment any
915
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
916
+ you can use `@pypi_base` to set packages required by all
917
+ steps and use `@pypi` to specify step-specific overrides.
862
918
 
863
919
  Parameters
864
920
  ----------
865
- load_policy : str, default: "fresh"
866
- The policy for loading the checkpoint. The following policies are supported:
867
- - "eager": Loads the the latest available checkpoint within the namespace.
868
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
869
- will be loaded at the start of the task.
870
- - "none": Do not load any checkpoint
871
- - "fresh": Loads the lastest checkpoint created within the running Task.
872
- This mode helps loading checkpoints across various retry attempts of the same task.
873
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
874
- created within the task will be loaded when the task is retries execution on failure.
875
-
876
- temp_dir_root : str, default: None
877
- The root directory under which `current.checkpoint.directory` will be created.
878
-
879
-
880
-
921
+ packages : Dict[str, str], default: {}
922
+ Packages to use for this step. The key is the name of the package
923
+ and the value is the version to use.
924
+ python : str, optional, default: None
925
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
926
+ that the version used will correspond to the version of the Python interpreter used to start the run.
881
927
  """
882
928
  ...
883
929
 
884
930
  @typing.overload
885
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
931
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
886
932
  ...
887
933
 
888
934
  @typing.overload
889
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
935
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
890
936
  ...
891
937
 
892
- def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = "fresh", temp_dir_root: str = None):
938
+ 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):
893
939
  """
894
- Enables checkpointing for a step.
940
+ Specifies the PyPI packages for the step.
895
941
 
942
+ Information in this decorator will augment any
943
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
944
+ you can use `@pypi_base` to set packages required by all
945
+ steps and use `@pypi` to specify step-specific overrides.
896
946
 
897
947
  Parameters
898
948
  ----------
899
- load_policy : str, default: "fresh"
900
- The policy for loading the checkpoint. The following policies are supported:
901
- - "eager": Loads the the latest available checkpoint within the namespace.
902
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
903
- will be loaded at the start of the task.
904
- - "none": Do not load any checkpoint
905
- - "fresh": Loads the lastest checkpoint created within the running Task.
906
- This mode helps loading checkpoints across various retry attempts of the same task.
907
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
908
- created within the task will be loaded when the task is retries execution on failure.
909
-
910
- temp_dir_root : str, default: None
911
- The root directory under which `current.checkpoint.directory` will be created.
912
-
913
-
914
-
949
+ packages : Dict[str, str], default: {}
950
+ Packages to use for this step. The key is the name of the package
951
+ and the value is the version to use.
952
+ python : str, optional, default: None
953
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
954
+ that the version used will correspond to the version of the Python interpreter used to start the run.
915
955
  """
916
956
  ...
917
957
 
918
958
  @typing.overload
919
- 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]]]:
959
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
920
960
  """
921
- Specifies the number of times the task corresponding
922
- to a step needs to be retried.
923
-
924
- This decorator is useful for handling transient errors, such as networking issues.
925
- If your task contains operations that can't be retried safely, e.g. database updates,
926
- it is advisable to annotate it with `@retry(times=0)`.
927
-
928
- This can be used in conjunction with the `@catch` decorator. The `@catch`
929
- decorator will execute a no-op task after all retries have been exhausted,
930
- ensuring that the flow execution can continue.
931
-
932
- Parameters
933
- ----------
934
- times : int, default 3
935
- Number of times to retry this task.
936
- minutes_between_retries : int, default 2
937
- Number of minutes between retries.
938
- """
939
- ...
940
-
941
- @typing.overload
942
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
943
- ...
944
-
945
- @typing.overload
946
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
947
- ...
948
-
949
- 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):
950
- """
951
- Specifies the number of times the task corresponding
952
- to a step needs to be retried.
953
-
954
- This decorator is useful for handling transient errors, such as networking issues.
955
- If your task contains operations that can't be retried safely, e.g. database updates,
956
- it is advisable to annotate it with `@retry(times=0)`.
957
-
958
- This can be used in conjunction with the `@catch` decorator. The `@catch`
959
- decorator will execute a no-op task after all retries have been exhausted,
960
- ensuring that the flow execution can continue.
961
-
962
- Parameters
963
- ----------
964
- times : int, default 3
965
- Number of times to retry this task.
966
- minutes_between_retries : int, default 2
967
- Number of minutes between retries.
968
- """
969
- ...
970
-
971
- @typing.overload
972
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
973
- """
974
- Decorator prototype for all step decorators. This function gets specialized
975
- and imported for all decorators types by _import_plugin_decorators().
961
+ Internal decorator to support Fast bakery
976
962
  """
977
963
  ...
978
964
 
979
965
  @typing.overload
980
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
966
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
981
967
  ...
982
968
 
983
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
969
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
984
970
  """
985
- Decorator prototype for all step decorators. This function gets specialized
986
- and imported for all decorators types by _import_plugin_decorators().
971
+ Internal decorator to support Fast bakery
987
972
  """
988
973
  ...
989
974
 
990
975
  @typing.overload
991
- def resources(*, cpu: int = 1, gpu: int = 0, 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]]]:
976
+ 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]]]:
992
977
  """
993
- Specifies the resources needed when executing this step.
994
-
995
- Use `@resources` to specify the resource requirements
996
- independently of the specific compute layer (`@batch`, `@kubernetes`).
978
+ Specifies that the step will success under all circumstances.
997
979
 
998
- You can choose the compute layer on the command line by executing e.g.
999
- ```
1000
- python myflow.py run --with batch
1001
- ```
1002
- or
1003
- ```
1004
- python myflow.py run --with kubernetes
1005
- ```
1006
- which executes the flow on the desired system using the
1007
- requirements specified in `@resources`.
980
+ The decorator will create an optional artifact, specified by `var`, which
981
+ contains the exception raised. You can use it to detect the presence
982
+ of errors, indicating that all happy-path artifacts produced by the step
983
+ are missing.
1008
984
 
1009
985
  Parameters
1010
986
  ----------
1011
- cpu : int, default 1
1012
- Number of CPUs required for this step.
1013
- gpu : int, default 0
1014
- Number of GPUs required for this step.
1015
- disk : int, optional, default None
1016
- Disk size (in MB) required for this step. Only applies on Kubernetes.
1017
- memory : int, default 4096
1018
- Memory size (in MB) required for this step.
1019
- shared_memory : int, optional, default None
1020
- The value for the size (in MiB) of the /dev/shm volume for this step.
1021
- This parameter maps to the `--shm-size` option in Docker.
987
+ var : str, optional, default None
988
+ Name of the artifact in which to store the caught exception.
989
+ If not specified, the exception is not stored.
990
+ print_exception : bool, default True
991
+ Determines whether or not the exception is printed to
992
+ stdout when caught.
1022
993
  """
1023
994
  ...
1024
995
 
1025
996
  @typing.overload
1026
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
997
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1027
998
  ...
1028
999
 
1029
1000
  @typing.overload
1030
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1001
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1031
1002
  ...
1032
1003
 
1033
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
1004
+ 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):
1034
1005
  """
1035
- Specifies the resources needed when executing this step.
1036
-
1037
- Use `@resources` to specify the resource requirements
1038
- independently of the specific compute layer (`@batch`, `@kubernetes`).
1006
+ Specifies that the step will success under all circumstances.
1039
1007
 
1040
- You can choose the compute layer on the command line by executing e.g.
1041
- ```
1042
- python myflow.py run --with batch
1043
- ```
1044
- or
1045
- ```
1046
- python myflow.py run --with kubernetes
1047
- ```
1048
- which executes the flow on the desired system using the
1049
- requirements specified in `@resources`.
1008
+ The decorator will create an optional artifact, specified by `var`, which
1009
+ contains the exception raised. You can use it to detect the presence
1010
+ of errors, indicating that all happy-path artifacts produced by the step
1011
+ are missing.
1050
1012
 
1051
1013
  Parameters
1052
1014
  ----------
1053
- cpu : int, default 1
1054
- Number of CPUs required for this step.
1055
- gpu : int, default 0
1056
- Number of GPUs required for this step.
1057
- disk : int, optional, default None
1058
- Disk size (in MB) required for this step. Only applies on Kubernetes.
1059
- memory : int, default 4096
1060
- Memory size (in MB) required for this step.
1061
- shared_memory : int, optional, default None
1062
- The value for the size (in MiB) of the /dev/shm volume for this step.
1063
- This parameter maps to the `--shm-size` option in Docker.
1015
+ var : str, optional, default None
1016
+ Name of the artifact in which to store the caught exception.
1017
+ If not specified, the exception is not stored.
1018
+ print_exception : bool, default True
1019
+ Determines whether or not the exception is printed to
1020
+ stdout when caught.
1064
1021
  """
1065
1022
  ...
1066
1023
 
1067
1024
  @typing.overload
1068
- 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]]]:
1025
+ 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]]]:
1069
1026
  """
1070
- Creates a human-readable report, a Metaflow Card, after this step completes.
1071
-
1072
- Note that you may add multiple `@card` decorators in a step with different parameters.
1027
+ Specifies secrets to be retrieved and injected as environment variables prior to
1028
+ the execution of a step.
1073
1029
 
1074
1030
  Parameters
1075
1031
  ----------
1076
- type : str, default 'default'
1077
- Card type.
1078
- id : str, optional, default None
1079
- If multiple cards are present, use this id to identify this card.
1080
- options : Dict[str, Any], default {}
1081
- Options passed to the card. The contents depend on the card type.
1082
- timeout : int, default 45
1083
- Interrupt reporting if it takes more than this many seconds.
1084
-
1085
-
1032
+ sources : List[Union[str, Dict[str, Any]]], default: []
1033
+ List of secret specs, defining how the secrets are to be retrieved
1086
1034
  """
1087
1035
  ...
1088
1036
 
1089
1037
  @typing.overload
1090
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1038
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1091
1039
  ...
1092
1040
 
1093
1041
  @typing.overload
1094
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1042
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1095
1043
  ...
1096
1044
 
1097
- 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):
1045
+ 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]]] = []):
1098
1046
  """
1099
- Creates a human-readable report, a Metaflow Card, after this step completes.
1100
-
1101
- Note that you may add multiple `@card` decorators in a step with different parameters.
1047
+ Specifies secrets to be retrieved and injected as environment variables prior to
1048
+ the execution of a step.
1102
1049
 
1103
1050
  Parameters
1104
1051
  ----------
1105
- type : str, default 'default'
1106
- Card type.
1107
- id : str, optional, default None
1108
- If multiple cards are present, use this id to identify this card.
1109
- options : Dict[str, Any], default {}
1110
- Options passed to the card. The contents depend on the card type.
1111
- timeout : int, default 45
1112
- Interrupt reporting if it takes more than this many seconds.
1113
-
1114
-
1052
+ sources : List[Union[str, Dict[str, Any]]], default: []
1053
+ List of secret specs, defining how the secrets are to be retrieved
1115
1054
  """
1116
1055
  ...
1117
1056
 
1118
1057
  @typing.overload
1119
- 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]]:
1058
+ def checkpoint(*, load_policy: str = "fresh", temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1120
1059
  """
1121
- Specifies the flow(s) that this flow depends on.
1122
-
1123
- ```
1124
- @trigger_on_finish(flow='FooFlow')
1125
- ```
1126
- or
1127
- ```
1128
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1129
- ```
1130
- This decorator respects the @project decorator and triggers the flow
1131
- when upstream runs within the same namespace complete successfully
1132
-
1133
- Additionally, you can specify project aware upstream flow dependencies
1134
- by specifying the fully qualified project_flow_name.
1135
- ```
1136
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1137
- ```
1138
- or
1139
- ```
1140
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1141
- ```
1142
-
1143
- You can also specify just the project or project branch (other values will be
1144
- inferred from the current project or project branch):
1145
- ```
1146
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1147
- ```
1060
+ Enables checkpointing for a step.
1148
1061
 
1149
- Note that `branch` is typically one of:
1150
- - `prod`
1151
- - `user.bob`
1152
- - `test.my_experiment`
1153
- - `prod.staging`
1154
1062
 
1155
1063
  Parameters
1156
1064
  ----------
1157
- flow : Union[str, Dict[str, str]], optional, default None
1158
- Upstream flow dependency for this flow.
1159
- flows : List[Union[str, Dict[str, str]]], default []
1160
- Upstream flow dependencies for this flow.
1161
- options : Dict[str, Any], default {}
1162
- Backend-specific configuration for tuning eventing behavior.
1065
+ load_policy : str, default: "fresh"
1066
+ The policy for loading the checkpoint. The following policies are supported:
1067
+ - "eager": Loads the the latest available checkpoint within the namespace.
1068
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
1069
+ will be loaded at the start of the task.
1070
+ - "none": Do not load any checkpoint
1071
+ - "fresh": Loads the lastest checkpoint created within the running Task.
1072
+ This mode helps loading checkpoints across various retry attempts of the same task.
1073
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
1074
+ created within the task will be loaded when the task is retries execution on failure.
1075
+
1076
+ temp_dir_root : str, default: None
1077
+ The root directory under which `current.checkpoint.directory` will be created.
1078
+
1163
1079
 
1164
1080
 
1165
1081
  """
1166
1082
  ...
1167
1083
 
1168
1084
  @typing.overload
1169
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1085
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1170
1086
  ...
1171
1087
 
1172
- def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1088
+ @typing.overload
1089
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1090
+ ...
1091
+
1092
+ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = "fresh", temp_dir_root: str = None):
1173
1093
  """
1174
- Specifies the flow(s) that this flow depends on.
1175
-
1176
- ```
1177
- @trigger_on_finish(flow='FooFlow')
1178
- ```
1179
- or
1180
- ```
1181
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1182
- ```
1183
- This decorator respects the @project decorator and triggers the flow
1184
- when upstream runs within the same namespace complete successfully
1185
-
1186
- Additionally, you can specify project aware upstream flow dependencies
1187
- by specifying the fully qualified project_flow_name.
1188
- ```
1189
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1190
- ```
1191
- or
1192
- ```
1193
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1194
- ```
1195
-
1196
- You can also specify just the project or project branch (other values will be
1197
- inferred from the current project or project branch):
1198
- ```
1199
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1200
- ```
1094
+ Enables checkpointing for a step.
1201
1095
 
1202
- Note that `branch` is typically one of:
1203
- - `prod`
1204
- - `user.bob`
1205
- - `test.my_experiment`
1206
- - `prod.staging`
1207
1096
 
1208
1097
  Parameters
1209
1098
  ----------
1210
- flow : Union[str, Dict[str, str]], optional, default None
1211
- Upstream flow dependency for this flow.
1212
- flows : List[Union[str, Dict[str, str]]], default []
1213
- Upstream flow dependencies for this flow.
1214
- options : Dict[str, Any], default {}
1215
- Backend-specific configuration for tuning eventing behavior.
1216
-
1217
-
1218
- """
1219
- ...
1220
-
1221
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1222
- """
1223
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1099
+ load_policy : str, default: "fresh"
1100
+ The policy for loading the checkpoint. The following policies are supported:
1101
+ - "eager": Loads the the latest available checkpoint within the namespace.
1102
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
1103
+ will be loaded at the start of the task.
1104
+ - "none": Do not load any checkpoint
1105
+ - "fresh": Loads the lastest checkpoint created within the running Task.
1106
+ This mode helps loading checkpoints across various retry attempts of the same task.
1107
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
1108
+ created within the task will be loaded when the task is retries execution on failure.
1224
1109
 
1225
- User code call
1226
- -----------
1227
- @nim(
1228
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1229
- backend='managed'
1230
- )
1110
+ temp_dir_root : str, default: None
1111
+ The root directory under which `current.checkpoint.directory` will be created.
1231
1112
 
1232
- Valid backend options
1233
- ---------------------
1234
- - 'managed': Outerbounds selects a compute provider based on the model.
1235
- - 🚧 'dataplane': Run in your account.
1236
1113
 
1237
- Valid model options
1238
- ----------------
1239
- - 'meta/llama3-8b-instruct': 8B parameter model
1240
- - 'meta/llama3-70b-instruct': 70B parameter model
1241
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1242
1114
 
1243
- Parameters
1244
- ----------
1245
- models: list[NIM]
1246
- List of NIM containers running models in sidecars.
1247
- backend: str
1248
- Compute provider to run the NIM container.
1249
1115
  """
1250
1116
  ...
1251
1117
 
1252
- @typing.overload
1253
- 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]]:
1118
+ 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]]:
1254
1119
  """
1255
- Specifies the times when the flow should be run when running on a
1256
- production scheduler.
1120
+ 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)
1121
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1122
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1123
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1124
+ starts only after all sensors finish.
1257
1125
 
1258
1126
  Parameters
1259
1127
  ----------
1260
- hourly : bool, default False
1261
- Run the workflow hourly.
1262
- daily : bool, default True
1263
- Run the workflow daily.
1264
- weekly : bool, default False
1265
- Run the workflow weekly.
1266
- cron : str, optional, default None
1267
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1268
- specified by this expression.
1269
- timezone : str, optional, default None
1270
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1271
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1128
+ timeout : int
1129
+ Time, in seconds before the task times out and fails. (Default: 3600)
1130
+ poke_interval : int
1131
+ Time in seconds that the job should wait in between each try. (Default: 60)
1132
+ mode : str
1133
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1134
+ exponential_backoff : bool
1135
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1136
+ pool : str
1137
+ the slot pool this task should run in,
1138
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1139
+ soft_fail : bool
1140
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1141
+ name : str
1142
+ Name of the sensor on Airflow
1143
+ description : str
1144
+ Description of sensor in the Airflow UI
1145
+ bucket_key : Union[str, List[str]]
1146
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1147
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1148
+ bucket_name : str
1149
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1150
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1151
+ wildcard_match : bool
1152
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1153
+ aws_conn_id : str
1154
+ a reference to the s3 connection on Airflow. (Default: None)
1155
+ verify : bool
1156
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1272
1157
  """
1273
1158
  ...
1274
1159
 
1275
- @typing.overload
1276
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1277
- ...
1278
-
1279
- 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):
1160
+ 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]]:
1280
1161
  """
1281
- Specifies the times when the flow should be run when running on a
1282
- production scheduler.
1162
+ 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.
1163
+ 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.
1283
1164
 
1284
1165
  Parameters
1285
1166
  ----------
1286
- hourly : bool, default False
1287
- Run the workflow hourly.
1288
- daily : bool, default True
1289
- Run the workflow daily.
1290
- weekly : bool, default False
1291
- Run the workflow weekly.
1292
- cron : str, optional, default None
1293
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1294
- specified by this expression.
1295
- timezone : str, optional, default None
1296
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1297
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1167
+ timeout : int
1168
+ Time, in seconds before the task times out and fails. (Default: 3600)
1169
+ poke_interval : int
1170
+ Time in seconds that the job should wait in between each try. (Default: 60)
1171
+ mode : str
1172
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1173
+ exponential_backoff : bool
1174
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1175
+ pool : str
1176
+ the slot pool this task should run in,
1177
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1178
+ soft_fail : bool
1179
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1180
+ name : str
1181
+ Name of the sensor on Airflow
1182
+ description : str
1183
+ Description of sensor in the Airflow UI
1184
+ external_dag_id : str
1185
+ The dag_id that contains the task you want to wait for.
1186
+ external_task_ids : List[str]
1187
+ The list of task_ids that you want to wait for.
1188
+ If None (default value) the sensor waits for the DAG. (Default: None)
1189
+ allowed_states : List[str]
1190
+ Iterable of allowed states, (Default: ['success'])
1191
+ failed_states : List[str]
1192
+ Iterable of failed or dis-allowed states. (Default: None)
1193
+ execution_delta : datetime.timedelta
1194
+ time difference with the previous execution to look at,
1195
+ the default is the same logical date as the current task or DAG. (Default: None)
1196
+ check_existence: bool
1197
+ Set to True to check if the external task exists or check if
1198
+ the DAG to wait for exists. (Default: True)
1298
1199
  """
1299
1200
  ...
1300
1201
 
@@ -1347,45 +1248,42 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1347
1248
  """
1348
1249
  ...
1349
1250
 
1350
- 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]]:
1251
+ @typing.overload
1252
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1351
1253
  """
1352
- 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.
1353
- 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.
1254
+ Specifies the PyPI packages for all steps of the flow.
1255
+
1256
+ Use `@pypi_base` to set common packages required by all
1257
+ steps and use `@pypi` to specify step-specific overrides.
1258
+ Parameters
1259
+ ----------
1260
+ packages : Dict[str, str], default: {}
1261
+ Packages to use for this flow. The key is the name of the package
1262
+ and the value is the version to use.
1263
+ python : str, optional, default: None
1264
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1265
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1266
+ """
1267
+ ...
1268
+
1269
+ @typing.overload
1270
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1271
+ ...
1272
+
1273
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1274
+ """
1275
+ Specifies the PyPI packages for all steps of the flow.
1354
1276
 
1277
+ Use `@pypi_base` to set common packages required by all
1278
+ steps and use `@pypi` to specify step-specific overrides.
1355
1279
  Parameters
1356
1280
  ----------
1357
- timeout : int
1358
- Time, in seconds before the task times out and fails. (Default: 3600)
1359
- poke_interval : int
1360
- Time in seconds that the job should wait in between each try. (Default: 60)
1361
- mode : str
1362
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1363
- exponential_backoff : bool
1364
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1365
- pool : str
1366
- the slot pool this task should run in,
1367
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1368
- soft_fail : bool
1369
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1370
- name : str
1371
- Name of the sensor on Airflow
1372
- description : str
1373
- Description of sensor in the Airflow UI
1374
- external_dag_id : str
1375
- The dag_id that contains the task you want to wait for.
1376
- external_task_ids : List[str]
1377
- The list of task_ids that you want to wait for.
1378
- If None (default value) the sensor waits for the DAG. (Default: None)
1379
- allowed_states : List[str]
1380
- Iterable of allowed states, (Default: ['success'])
1381
- failed_states : List[str]
1382
- Iterable of failed or dis-allowed states. (Default: None)
1383
- execution_delta : datetime.timedelta
1384
- time difference with the previous execution to look at,
1385
- the default is the same logical date as the current task or DAG. (Default: None)
1386
- check_existence: bool
1387
- Set to True to check if the external task exists or check if
1388
- the DAG to wait for exists. (Default: True)
1281
+ packages : Dict[str, str], default: {}
1282
+ Packages to use for this flow. The key is the name of the package
1283
+ and the value is the version to use.
1284
+ python : str, optional, default: None
1285
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1286
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1389
1287
  """
1390
1288
  ...
1391
1289
 
@@ -1407,45 +1305,83 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
1407
1305
  """
1408
1306
  ...
1409
1307
 
1410
- 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]]:
1308
+ @typing.overload
1309
+ 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]]:
1411
1310
  """
1412
- 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)
1413
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1414
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1415
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1416
- starts only after all sensors finish.
1311
+ Specifies the times when the flow should be run when running on a
1312
+ production scheduler.
1417
1313
 
1418
1314
  Parameters
1419
1315
  ----------
1420
- timeout : int
1421
- Time, in seconds before the task times out and fails. (Default: 3600)
1422
- poke_interval : int
1423
- Time in seconds that the job should wait in between each try. (Default: 60)
1424
- mode : str
1425
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1426
- exponential_backoff : bool
1427
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1428
- pool : str
1429
- the slot pool this task should run in,
1430
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1431
- soft_fail : bool
1432
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1433
- name : str
1434
- Name of the sensor on Airflow
1435
- description : str
1436
- Description of sensor in the Airflow UI
1437
- bucket_key : Union[str, List[str]]
1438
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1439
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1440
- bucket_name : str
1441
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1442
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1443
- wildcard_match : bool
1444
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1445
- aws_conn_id : str
1446
- a reference to the s3 connection on Airflow. (Default: None)
1447
- verify : bool
1448
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1316
+ hourly : bool, default False
1317
+ Run the workflow hourly.
1318
+ daily : bool, default True
1319
+ Run the workflow daily.
1320
+ weekly : bool, default False
1321
+ Run the workflow weekly.
1322
+ cron : str, optional, default None
1323
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1324
+ specified by this expression.
1325
+ timezone : str, optional, default None
1326
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1327
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1328
+ """
1329
+ ...
1330
+
1331
+ @typing.overload
1332
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1333
+ ...
1334
+
1335
+ 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):
1336
+ """
1337
+ Specifies the times when the flow should be run when running on a
1338
+ production scheduler.
1339
+
1340
+ Parameters
1341
+ ----------
1342
+ hourly : bool, default False
1343
+ Run the workflow hourly.
1344
+ daily : bool, default True
1345
+ Run the workflow daily.
1346
+ weekly : bool, default False
1347
+ Run the workflow weekly.
1348
+ cron : str, optional, default None
1349
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1350
+ specified by this expression.
1351
+ timezone : str, optional, default None
1352
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1353
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1354
+ """
1355
+ ...
1356
+
1357
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1358
+ """
1359
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1360
+
1361
+ User code call
1362
+ -----------
1363
+ @nim(
1364
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1365
+ backend='managed'
1366
+ )
1367
+
1368
+ Valid backend options
1369
+ ---------------------
1370
+ - 'managed': Outerbounds selects a compute provider based on the model.
1371
+ - 🚧 'dataplane': Run in your account.
1372
+
1373
+ Valid model options
1374
+ ----------------
1375
+ - 'meta/llama3-8b-instruct': 8B parameter model
1376
+ - 'meta/llama3-70b-instruct': 70B parameter model
1377
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1378
+
1379
+ Parameters
1380
+ ----------
1381
+ models: list[NIM]
1382
+ List of NIM containers running models in sidecars.
1383
+ backend: str
1384
+ Compute provider to run the NIM container.
1449
1385
  """
1450
1386
  ...
1451
1387
 
@@ -1545,41 +1481,105 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1545
1481
  ...
1546
1482
 
1547
1483
  @typing.overload
1548
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1484
+ 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]]:
1549
1485
  """
1550
- Specifies the PyPI packages for all steps of the flow.
1486
+ Specifies the flow(s) that this flow depends on.
1487
+
1488
+ ```
1489
+ @trigger_on_finish(flow='FooFlow')
1490
+ ```
1491
+ or
1492
+ ```
1493
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1494
+ ```
1495
+ This decorator respects the @project decorator and triggers the flow
1496
+ when upstream runs within the same namespace complete successfully
1497
+
1498
+ Additionally, you can specify project aware upstream flow dependencies
1499
+ by specifying the fully qualified project_flow_name.
1500
+ ```
1501
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1502
+ ```
1503
+ or
1504
+ ```
1505
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1506
+ ```
1507
+
1508
+ You can also specify just the project or project branch (other values will be
1509
+ inferred from the current project or project branch):
1510
+ ```
1511
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1512
+ ```
1513
+
1514
+ Note that `branch` is typically one of:
1515
+ - `prod`
1516
+ - `user.bob`
1517
+ - `test.my_experiment`
1518
+ - `prod.staging`
1551
1519
 
1552
- Use `@pypi_base` to set common packages required by all
1553
- steps and use `@pypi` to specify step-specific overrides.
1554
1520
  Parameters
1555
1521
  ----------
1556
- packages : Dict[str, str], default: {}
1557
- Packages to use for this flow. The key is the name of the package
1558
- and the value is the version to use.
1559
- python : str, optional, default: None
1560
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1561
- that the version used will correspond to the version of the Python interpreter used to start the run.
1522
+ flow : Union[str, Dict[str, str]], optional, default None
1523
+ Upstream flow dependency for this flow.
1524
+ flows : List[Union[str, Dict[str, str]]], default []
1525
+ Upstream flow dependencies for this flow.
1526
+ options : Dict[str, Any], default {}
1527
+ Backend-specific configuration for tuning eventing behavior.
1528
+
1529
+
1562
1530
  """
1563
1531
  ...
1564
1532
 
1565
1533
  @typing.overload
1566
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1534
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1567
1535
  ...
1568
1536
 
1569
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1537
+ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1570
1538
  """
1571
- Specifies the PyPI packages for all steps of the flow.
1539
+ Specifies the flow(s) that this flow depends on.
1540
+
1541
+ ```
1542
+ @trigger_on_finish(flow='FooFlow')
1543
+ ```
1544
+ or
1545
+ ```
1546
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1547
+ ```
1548
+ This decorator respects the @project decorator and triggers the flow
1549
+ when upstream runs within the same namespace complete successfully
1550
+
1551
+ Additionally, you can specify project aware upstream flow dependencies
1552
+ by specifying the fully qualified project_flow_name.
1553
+ ```
1554
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1555
+ ```
1556
+ or
1557
+ ```
1558
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1559
+ ```
1560
+
1561
+ You can also specify just the project or project branch (other values will be
1562
+ inferred from the current project or project branch):
1563
+ ```
1564
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1565
+ ```
1566
+
1567
+ Note that `branch` is typically one of:
1568
+ - `prod`
1569
+ - `user.bob`
1570
+ - `test.my_experiment`
1571
+ - `prod.staging`
1572
1572
 
1573
- Use `@pypi_base` to set common packages required by all
1574
- steps and use `@pypi` to specify step-specific overrides.
1575
1573
  Parameters
1576
1574
  ----------
1577
- packages : Dict[str, str], default: {}
1578
- Packages to use for this flow. The key is the name of the package
1579
- and the value is the version to use.
1580
- python : str, optional, default: None
1581
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1582
- that the version used will correspond to the version of the Python interpreter used to start the run.
1575
+ flow : Union[str, Dict[str, str]], optional, default None
1576
+ Upstream flow dependency for this flow.
1577
+ flows : List[Union[str, Dict[str, str]]], default []
1578
+ Upstream flow dependencies for this flow.
1579
+ options : Dict[str, Any], default {}
1580
+ Backend-specific configuration for tuning eventing behavior.
1581
+
1582
+
1583
1583
  """
1584
1584
  ...
1585
1585