ob-metaflow-stubs 5.9__py2.py3-none-any.whl → 5.10__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. metaflow-stubs/__init__.pyi +541 -543
  2. metaflow-stubs/cards.pyi +5 -5
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +4 -4
  5. metaflow-stubs/client/core.pyi +6 -6
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +3 -3
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +5 -5
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +5 -5
  13. metaflow-stubs/info_file.pyi +16 -0
  14. metaflow-stubs/metadata/metadata.pyi +2 -2
  15. metaflow-stubs/metadata/util.pyi +2 -2
  16. metaflow-stubs/metaflow_config.pyi +2 -2
  17. metaflow-stubs/metaflow_current.pyi +18 -18
  18. metaflow-stubs/mflog/mflog.pyi +2 -2
  19. metaflow-stubs/multicore_utils.pyi +2 -2
  20. metaflow-stubs/parameters.pyi +4 -4
  21. metaflow-stubs/plugins/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  23. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  24. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  28. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  29. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  30. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  31. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  32. metaflow-stubs/plugins/argo/argo_workflows.pyi +5 -5
  33. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +5 -5
  34. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +7 -7
  35. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  36. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  37. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  38. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  39. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  43. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  44. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  45. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  46. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  47. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  52. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  53. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  54. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  55. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  56. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  57. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  58. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  59. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  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 +2 -2
  63. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  64. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  67. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  69. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +3 -3
  72. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  73. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  74. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  75. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  76. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  77. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  78. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  79. metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -6
  80. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  81. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  82. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  83. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  84. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  85. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  86. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  87. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  88. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  89. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  90. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  91. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  92. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  93. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  94. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  95. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  96. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  97. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +4 -4
  98. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  99. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  100. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  101. metaflow-stubs/plugins/logs_cli.pyi +3 -3
  102. metaflow-stubs/plugins/package_cli.pyi +2 -2
  103. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  104. metaflow-stubs/plugins/perimeters.pyi +2 -2
  105. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  106. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  107. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  109. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  110. metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
  111. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  112. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  114. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  115. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  116. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  118. metaflow-stubs/plugins/tag_cli.pyi +3 -3
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  121. metaflow-stubs/procpoll.pyi +2 -2
  122. metaflow-stubs/profilers/__init__.pyi +2 -2
  123. metaflow-stubs/pylint_wrapper.pyi +2 -2
  124. metaflow-stubs/runner/__init__.pyi +2 -2
  125. metaflow-stubs/runner/deployer.pyi +3 -3
  126. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  127. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  128. metaflow-stubs/runner/nbrun.pyi +2 -2
  129. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  130. metaflow-stubs/runner/utils.pyi +2 -2
  131. metaflow-stubs/system/__init__.pyi +3 -3
  132. metaflow-stubs/system/system_logger.pyi +2 -2
  133. metaflow-stubs/system/system_monitor.pyi +2 -2
  134. metaflow-stubs/tagging_util.pyi +2 -2
  135. metaflow-stubs/tuple_util.pyi +2 -2
  136. {ob_metaflow_stubs-5.9.dist-info → ob_metaflow_stubs-5.10.dist-info}/METADATA +1 -1
  137. ob_metaflow_stubs-5.10.dist-info/RECORD +140 -0
  138. ob_metaflow_stubs-5.9.dist-info/RECORD +0 -139
  139. {ob_metaflow_stubs-5.9.dist-info → ob_metaflow_stubs-5.10.dist-info}/WHEEL +0 -0
  140. {ob_metaflow_stubs-5.9.dist-info → ob_metaflow_stubs-5.10.dist-info}/top_level.txt +0 -0
@@ -1,30 +1,26 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.20.1+ob(v1) #
4
- # Generated on 2024-09-16T17:51:44.698904 #
3
+ # MF version: 2.12.22.1+ob(v1) #
4
+ # Generated on 2024-09-20T00:12:02.818960 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import metaflow._vendor.click.types
11
+ import metaflow.events
12
12
  import metaflow.datastore.inputs
13
- import metaflow.parameters
14
- import typing
15
13
  import metaflow.runner.metaflow_runner
16
14
  import metaflow.metaflow_current
17
- import metaflow.events
15
+ import metaflow.flowspec
18
16
  import datetime
19
17
  import metaflow.client.core
20
- import metaflow.flowspec
18
+ import metaflow._vendor.click.types
19
+ import typing
20
+ import metaflow.parameters
21
21
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
22
22
  StepFlag = typing.NewType("StepFlag", bool)
23
23
 
24
- CURRENT_DIRECTORY: str
25
-
26
- INFO_FILE: str
27
-
28
24
  EXT_PKG: str
29
25
 
30
26
  def parallel_imap_unordered(func: typing.Callable[[typing.Any], typing.Any], iterable: typing.Iterable[typing.Any], max_parallel: typing.Optional[int] = None, dir: typing.Optional[str] = None) -> typing.Iterator[typing.Any]:
@@ -488,6 +484,121 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
488
484
  """
489
485
  ...
490
486
 
487
+ @typing.overload
488
+ 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]]]:
489
+ """
490
+ Specifies that the step will success under all circumstances.
491
+
492
+ The decorator will create an optional artifact, specified by `var`, which
493
+ contains the exception raised. You can use it to detect the presence
494
+ of errors, indicating that all happy-path artifacts produced by the step
495
+ are missing.
496
+
497
+ Parameters
498
+ ----------
499
+ var : str, optional, default None
500
+ Name of the artifact in which to store the caught exception.
501
+ If not specified, the exception is not stored.
502
+ print_exception : bool, default True
503
+ Determines whether or not the exception is printed to
504
+ stdout when caught.
505
+ """
506
+ ...
507
+
508
+ @typing.overload
509
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
510
+ ...
511
+
512
+ @typing.overload
513
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
514
+ ...
515
+
516
+ 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):
517
+ """
518
+ Specifies that the step will success under all circumstances.
519
+
520
+ The decorator will create an optional artifact, specified by `var`, which
521
+ contains the exception raised. You can use it to detect the presence
522
+ of errors, indicating that all happy-path artifacts produced by the step
523
+ are missing.
524
+
525
+ Parameters
526
+ ----------
527
+ var : str, optional, default None
528
+ Name of the artifact in which to store the caught exception.
529
+ If not specified, the exception is not stored.
530
+ print_exception : bool, default True
531
+ Determines whether or not the exception is printed to
532
+ stdout when caught.
533
+ """
534
+ ...
535
+
536
+ @typing.overload
537
+ 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]]]:
538
+ """
539
+ Specifies the PyPI packages for the step.
540
+
541
+ Information in this decorator will augment any
542
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
543
+ you can use `@pypi_base` to set packages required by all
544
+ steps and use `@pypi` to specify step-specific overrides.
545
+
546
+ Parameters
547
+ ----------
548
+ packages : Dict[str, str], default: {}
549
+ Packages to use for this step. The key is the name of the package
550
+ and the value is the version to use.
551
+ python : str, optional, default: None
552
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
553
+ that the version used will correspond to the version of the Python interpreter used to start the run.
554
+ """
555
+ ...
556
+
557
+ @typing.overload
558
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
559
+ ...
560
+
561
+ @typing.overload
562
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
563
+ ...
564
+
565
+ 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):
566
+ """
567
+ Specifies the PyPI packages for the step.
568
+
569
+ Information in this decorator will augment any
570
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
571
+ you can use `@pypi_base` to set packages required by all
572
+ steps and use `@pypi` to specify step-specific overrides.
573
+
574
+ Parameters
575
+ ----------
576
+ packages : Dict[str, str], default: {}
577
+ Packages to use for this step. The key is the name of the package
578
+ and the value is the version to use.
579
+ python : str, optional, default: None
580
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
581
+ that the version used will correspond to the version of the Python interpreter used to start the run.
582
+ """
583
+ ...
584
+
585
+ @typing.overload
586
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
587
+ """
588
+ Internal decorator to support Fast bakery
589
+ """
590
+ ...
591
+
592
+ @typing.overload
593
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
594
+ ...
595
+
596
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
597
+ """
598
+ Internal decorator to support Fast bakery
599
+ """
600
+ ...
601
+
491
602
  @typing.overload
492
603
  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]]]:
493
604
  """
@@ -565,6 +676,39 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
565
676
  """
566
677
  ...
567
678
 
679
+ @typing.overload
680
+ 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]]]:
681
+ """
682
+ Specifies secrets to be retrieved and injected as environment variables prior to
683
+ the execution of a step.
684
+
685
+ Parameters
686
+ ----------
687
+ sources : List[Union[str, Dict[str, Any]]], default: []
688
+ List of secret specs, defining how the secrets are to be retrieved
689
+ """
690
+ ...
691
+
692
+ @typing.overload
693
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
694
+ ...
695
+
696
+ @typing.overload
697
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
698
+ ...
699
+
700
+ 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]]] = []):
701
+ """
702
+ Specifies secrets to be retrieved and injected as environment variables prior to
703
+ the execution of a step.
704
+
705
+ Parameters
706
+ ----------
707
+ sources : List[Union[str, Dict[str, Any]]], default: []
708
+ List of secret specs, defining how the secrets are to be retrieved
709
+ """
710
+ ...
711
+
568
712
  @typing.overload
569
713
  def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
570
714
  """
@@ -597,167 +741,131 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
597
741
  ...
598
742
 
599
743
  @typing.overload
600
- 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]]]:
744
+ 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]]]:
601
745
  """
602
- Specifies that the step will success under all circumstances.
746
+ Specifies the number of times the task corresponding
747
+ to a step needs to be retried.
603
748
 
604
- The decorator will create an optional artifact, specified by `var`, which
605
- contains the exception raised. You can use it to detect the presence
606
- of errors, indicating that all happy-path artifacts produced by the step
607
- are missing.
749
+ This decorator is useful for handling transient errors, such as networking issues.
750
+ If your task contains operations that can't be retried safely, e.g. database updates,
751
+ it is advisable to annotate it with `@retry(times=0)`.
752
+
753
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
754
+ decorator will execute a no-op task after all retries have been exhausted,
755
+ ensuring that the flow execution can continue.
608
756
 
609
757
  Parameters
610
758
  ----------
611
- var : str, optional, default None
612
- Name of the artifact in which to store the caught exception.
613
- If not specified, the exception is not stored.
614
- print_exception : bool, default True
615
- Determines whether or not the exception is printed to
616
- stdout when caught.
759
+ times : int, default 3
760
+ Number of times to retry this task.
761
+ minutes_between_retries : int, default 2
762
+ Number of minutes between retries.
617
763
  """
618
764
  ...
619
765
 
620
766
  @typing.overload
621
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
767
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
622
768
  ...
623
769
 
624
770
  @typing.overload
625
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
771
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
626
772
  ...
627
773
 
628
- 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):
774
+ 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):
629
775
  """
630
- Specifies that the step will success under all circumstances.
776
+ Specifies the number of times the task corresponding
777
+ to a step needs to be retried.
631
778
 
632
- The decorator will create an optional artifact, specified by `var`, which
633
- contains the exception raised. You can use it to detect the presence
634
- of errors, indicating that all happy-path artifacts produced by the step
635
- are missing.
779
+ This decorator is useful for handling transient errors, such as networking issues.
780
+ If your task contains operations that can't be retried safely, e.g. database updates,
781
+ it is advisable to annotate it with `@retry(times=0)`.
782
+
783
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
784
+ decorator will execute a no-op task after all retries have been exhausted,
785
+ ensuring that the flow execution can continue.
636
786
 
637
787
  Parameters
638
788
  ----------
639
- var : str, optional, default None
640
- Name of the artifact in which to store the caught exception.
641
- If not specified, the exception is not stored.
642
- print_exception : bool, default True
643
- Determines whether or not the exception is printed to
644
- stdout when caught.
789
+ times : int, default 3
790
+ Number of times to retry this task.
791
+ minutes_between_retries : int, default 2
792
+ Number of minutes between retries.
645
793
  """
646
794
  ...
647
795
 
648
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None) -> 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]]]:
796
+ @typing.overload
797
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
649
798
  """
650
- Specifies that this step should execute on Kubernetes.
799
+ Decorator prototype for all step decorators. This function gets specialized
800
+ and imported for all decorators types by _import_plugin_decorators().
801
+ """
802
+ ...
803
+
804
+ @typing.overload
805
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
806
+ ...
807
+
808
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
809
+ """
810
+ Decorator prototype for all step decorators. This function gets specialized
811
+ and imported for all decorators types by _import_plugin_decorators().
812
+ """
813
+ ...
814
+
815
+ @typing.overload
816
+ 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]]]:
817
+ """
818
+ Specifies the Conda environment for the step.
819
+
820
+ Information in this decorator will augment any
821
+ attributes set in the `@conda_base` flow-level decorator. Hence,
822
+ you can use `@conda_base` to set packages required by all
823
+ steps and use `@conda` to specify step-specific overrides.
651
824
 
652
825
  Parameters
653
826
  ----------
654
- cpu : int, default 1
655
- Number of CPUs required for this step. If `@resources` is
656
- also present, the maximum value from all decorators is used.
657
- memory : int, default 4096
658
- Memory size (in MB) required for this step. If
659
- `@resources` is also present, the maximum value from all decorators is
660
- used.
661
- disk : int, default 10240
662
- Disk size (in MB) required for this step. If
663
- `@resources` is also present, the maximum value from all decorators is
664
- used.
665
- image : str, optional, default None
666
- Docker image to use when launching on Kubernetes. If not specified, and
667
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
668
- not, a default Docker image mapping to the current version of Python is used.
669
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
670
- If given, the imagePullPolicy to be applied to the Docker image of the step.
671
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
672
- Kubernetes service account to use when launching pod in Kubernetes.
673
- secrets : List[str], optional, default None
674
- Kubernetes secrets to use when launching pod in Kubernetes. These
675
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
676
- in Metaflow configuration.
677
- node_selector: Union[Dict[str,str], str], optional, default None
678
- Kubernetes node selector(s) to apply to the pod running the task.
679
- Can be passed in as a comma separated string of values e.g. "kubernetes.io/os=linux,kubernetes.io/arch=amd64"
680
- or as a dictionary {"kubernetes.io/os": "linux", "kubernetes.io/arch": "amd64"}
681
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
682
- Kubernetes namespace to use when launching pod in Kubernetes.
683
- gpu : int, optional, default None
684
- Number of GPUs required for this step. A value of zero implies that
685
- the scheduled node should not have GPUs.
686
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
687
- The vendor of the GPUs to be used for this step.
688
- tolerations : List[str], default []
689
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
690
- Kubernetes tolerations to use when launching pod in Kubernetes.
691
- use_tmpfs : bool, default False
692
- This enables an explicit tmpfs mount for this step.
693
- tmpfs_tempdir : bool, default True
694
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
695
- tmpfs_size : int, optional, default: None
696
- The value for the size (in MiB) of the tmpfs mount for this step.
697
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
698
- memory allocated for this step.
699
- tmpfs_path : str, optional, default /metaflow_temp
700
- Path to tmpfs mount for this step.
701
- persistent_volume_claims : Dict[str, str], optional, default None
702
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
703
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
704
- shared_memory: int, optional
705
- Shared memory size (in MiB) required for this step
706
- port: int, optional
707
- Port number to specify in the Kubernetes job object
708
- compute_pool : str, optional, default None
709
- Compute pool to be used for for this step.
710
- If not specified, any accessible compute pool within the perimeter is used.
711
- """
712
- ...
713
-
714
- @typing.overload
715
- 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]]]:
716
- """
717
- Specifies secrets to be retrieved and injected as environment variables prior to
718
- the execution of a step.
719
-
720
- Parameters
721
- ----------
722
- sources : List[Union[str, Dict[str, Any]]], default: []
723
- List of secret specs, defining how the secrets are to be retrieved
827
+ packages : Dict[str, str], default {}
828
+ Packages to use for this step. The key is the name of the package
829
+ and the value is the version to use.
830
+ libraries : Dict[str, str], default {}
831
+ Supported for backward compatibility. When used with packages, packages will take precedence.
832
+ python : str, optional, default None
833
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
834
+ that the version used will correspond to the version of the Python interpreter used to start the run.
835
+ disabled : bool, default False
836
+ If set to True, disables @conda.
724
837
  """
725
838
  ...
726
839
 
727
840
  @typing.overload
728
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
841
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
729
842
  ...
730
843
 
731
844
  @typing.overload
732
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
845
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
733
846
  ...
734
847
 
735
- 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]]] = []):
848
+ 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):
736
849
  """
737
- Specifies secrets to be retrieved and injected as environment variables prior to
738
- the execution of a step.
850
+ Specifies the Conda environment for the step.
851
+
852
+ Information in this decorator will augment any
853
+ attributes set in the `@conda_base` flow-level decorator. Hence,
854
+ you can use `@conda_base` to set packages required by all
855
+ steps and use `@conda` to specify step-specific overrides.
739
856
 
740
857
  Parameters
741
858
  ----------
742
- sources : List[Union[str, Dict[str, Any]]], default: []
743
- List of secret specs, defining how the secrets are to be retrieved
744
- """
745
- ...
746
-
747
- @typing.overload
748
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
749
- """
750
- Internal decorator to support Fast bakery
751
- """
752
- ...
753
-
754
- @typing.overload
755
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
756
- ...
757
-
758
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
759
- """
760
- Internal decorator to support Fast bakery
859
+ packages : Dict[str, str], default {}
860
+ Packages to use for this step. The key is the name of the package
861
+ and the value is the version to use.
862
+ libraries : Dict[str, str], default {}
863
+ Supported for backward compatibility. When used with packages, packages will take precedence.
864
+ python : str, optional, default None
865
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
866
+ that the version used will correspond to the version of the Python interpreter used to start the run.
867
+ disabled : bool, default False
868
+ If set to True, disables @conda.
761
869
  """
762
870
  ...
763
871
 
@@ -818,414 +926,206 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
818
926
  """
819
927
  ...
820
928
 
821
- @typing.overload
822
- 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]]]:
929
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None) -> 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]]]:
823
930
  """
824
- Specifies the number of times the task corresponding
825
- to a step needs to be retried.
826
-
827
- This decorator is useful for handling transient errors, such as networking issues.
828
- If your task contains operations that can't be retried safely, e.g. database updates,
829
- it is advisable to annotate it with `@retry(times=0)`.
830
-
831
- This can be used in conjunction with the `@catch` decorator. The `@catch`
832
- decorator will execute a no-op task after all retries have been exhausted,
833
- ensuring that the flow execution can continue.
931
+ Specifies that this step should execute on Kubernetes.
834
932
 
835
933
  Parameters
836
934
  ----------
837
- times : int, default 3
838
- Number of times to retry this task.
839
- minutes_between_retries : int, default 2
840
- Number of minutes between retries.
935
+ cpu : int, default 1
936
+ Number of CPUs required for this step. If `@resources` is
937
+ also present, the maximum value from all decorators is used.
938
+ memory : int, default 4096
939
+ Memory size (in MB) required for this step. If
940
+ `@resources` is also present, the maximum value from all decorators is
941
+ used.
942
+ disk : int, default 10240
943
+ Disk size (in MB) required for this step. If
944
+ `@resources` is also present, the maximum value from all decorators is
945
+ used.
946
+ image : str, optional, default None
947
+ Docker image to use when launching on Kubernetes. If not specified, and
948
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
949
+ not, a default Docker image mapping to the current version of Python is used.
950
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
951
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
952
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
953
+ Kubernetes service account to use when launching pod in Kubernetes.
954
+ secrets : List[str], optional, default None
955
+ Kubernetes secrets to use when launching pod in Kubernetes. These
956
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
957
+ in Metaflow configuration.
958
+ node_selector: Union[Dict[str,str], str], optional, default None
959
+ Kubernetes node selector(s) to apply to the pod running the task.
960
+ Can be passed in as a comma separated string of values e.g. "kubernetes.io/os=linux,kubernetes.io/arch=amd64"
961
+ or as a dictionary {"kubernetes.io/os": "linux", "kubernetes.io/arch": "amd64"}
962
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
963
+ Kubernetes namespace to use when launching pod in Kubernetes.
964
+ gpu : int, optional, default None
965
+ Number of GPUs required for this step. A value of zero implies that
966
+ the scheduled node should not have GPUs.
967
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
968
+ The vendor of the GPUs to be used for this step.
969
+ tolerations : List[str], default []
970
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
971
+ Kubernetes tolerations to use when launching pod in Kubernetes.
972
+ use_tmpfs : bool, default False
973
+ This enables an explicit tmpfs mount for this step.
974
+ tmpfs_tempdir : bool, default True
975
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
976
+ tmpfs_size : int, optional, default: None
977
+ The value for the size (in MiB) of the tmpfs mount for this step.
978
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
979
+ memory allocated for this step.
980
+ tmpfs_path : str, optional, default /metaflow_temp
981
+ Path to tmpfs mount for this step.
982
+ persistent_volume_claims : Dict[str, str], optional, default None
983
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
984
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
985
+ shared_memory: int, optional
986
+ Shared memory size (in MiB) required for this step
987
+ port: int, optional
988
+ Port number to specify in the Kubernetes job object
989
+ compute_pool : str, optional, default None
990
+ Compute pool to be used for for this step.
991
+ If not specified, any accessible compute pool within the perimeter is used.
841
992
  """
842
993
  ...
843
994
 
844
995
  @typing.overload
845
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
846
- ...
847
-
848
- @typing.overload
849
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
850
- ...
851
-
852
- 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):
996
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
853
997
  """
854
- Specifies the number of times the task corresponding
855
- to a step needs to be retried.
856
-
857
- This decorator is useful for handling transient errors, such as networking issues.
858
- If your task contains operations that can't be retried safely, e.g. database updates,
859
- it is advisable to annotate it with `@retry(times=0)`.
860
-
861
- This can be used in conjunction with the `@catch` decorator. The `@catch`
862
- decorator will execute a no-op task after all retries have been exhausted,
863
- ensuring that the flow execution can continue.
998
+ Specifies the PyPI packages for all steps of the flow.
864
999
 
1000
+ Use `@pypi_base` to set common packages required by all
1001
+ steps and use `@pypi` to specify step-specific overrides.
865
1002
  Parameters
866
1003
  ----------
867
- times : int, default 3
868
- Number of times to retry this task.
869
- minutes_between_retries : int, default 2
870
- Number of minutes between retries.
1004
+ packages : Dict[str, str], default: {}
1005
+ Packages to use for this flow. The key is the name of the package
1006
+ and the value is the version to use.
1007
+ python : str, optional, default: None
1008
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1009
+ that the version used will correspond to the version of the Python interpreter used to start the run.
871
1010
  """
872
1011
  ...
873
1012
 
874
1013
  @typing.overload
875
- 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]]]:
1014
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1015
+ ...
1016
+
1017
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
876
1018
  """
877
- Specifies the Conda environment for the step.
878
-
879
- Information in this decorator will augment any
880
- attributes set in the `@conda_base` flow-level decorator. Hence,
881
- you can use `@conda_base` to set packages required by all
882
- steps and use `@conda` to specify step-specific overrides.
1019
+ Specifies the PyPI packages for all steps of the flow.
883
1020
 
1021
+ Use `@pypi_base` to set common packages required by all
1022
+ steps and use `@pypi` to specify step-specific overrides.
884
1023
  Parameters
885
1024
  ----------
886
- packages : Dict[str, str], default {}
887
- Packages to use for this step. The key is the name of the package
1025
+ packages : Dict[str, str], default: {}
1026
+ Packages to use for this flow. The key is the name of the package
888
1027
  and the value is the version to use.
889
- libraries : Dict[str, str], default {}
890
- Supported for backward compatibility. When used with packages, packages will take precedence.
891
- python : str, optional, default None
1028
+ python : str, optional, default: None
892
1029
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
893
1030
  that the version used will correspond to the version of the Python interpreter used to start the run.
894
- disabled : bool, default False
895
- If set to True, disables @conda.
896
1031
  """
897
1032
  ...
898
1033
 
899
1034
  @typing.overload
900
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
901
- ...
902
-
903
- @typing.overload
904
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
905
- ...
906
-
907
- 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):
1035
+ 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]]:
908
1036
  """
909
- Specifies the Conda environment for the step.
910
-
911
- Information in this decorator will augment any
912
- attributes set in the `@conda_base` flow-level decorator. Hence,
913
- you can use `@conda_base` to set packages required by all
914
- steps and use `@conda` to specify step-specific overrides.
915
-
916
- Parameters
917
- ----------
918
- packages : Dict[str, str], default {}
919
- Packages to use for this step. The key is the name of the package
920
- and the value is the version to use.
921
- libraries : Dict[str, str], default {}
922
- Supported for backward compatibility. When used with packages, packages will take precedence.
923
- python : str, optional, default None
924
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
925
- that the version used will correspond to the version of the Python interpreter used to start the run.
926
- disabled : bool, default False
927
- If set to True, disables @conda.
928
- """
929
- ...
930
-
931
- @typing.overload
932
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
933
- """
934
- Decorator prototype for all step decorators. This function gets specialized
935
- and imported for all decorators types by _import_plugin_decorators().
936
- """
937
- ...
938
-
939
- @typing.overload
940
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
941
- ...
942
-
943
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
944
- """
945
- Decorator prototype for all step decorators. This function gets specialized
946
- and imported for all decorators types by _import_plugin_decorators().
947
- """
948
- ...
949
-
950
- @typing.overload
951
- 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]]]:
952
- """
953
- Specifies the PyPI packages for the step.
954
-
955
- Information in this decorator will augment any
956
- attributes set in the `@pyi_base` flow-level decorator. Hence,
957
- you can use `@pypi_base` to set packages required by all
958
- steps and use `@pypi` to specify step-specific overrides.
1037
+ Specifies the times when the flow should be run when running on a
1038
+ production scheduler.
959
1039
 
960
1040
  Parameters
961
1041
  ----------
962
- packages : Dict[str, str], default: {}
963
- Packages to use for this step. The key is the name of the package
964
- and the value is the version to use.
965
- python : str, optional, default: None
966
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
967
- that the version used will correspond to the version of the Python interpreter used to start the run.
1042
+ hourly : bool, default False
1043
+ Run the workflow hourly.
1044
+ daily : bool, default True
1045
+ Run the workflow daily.
1046
+ weekly : bool, default False
1047
+ Run the workflow weekly.
1048
+ cron : str, optional, default None
1049
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1050
+ specified by this expression.
1051
+ timezone : str, optional, default None
1052
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1053
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
968
1054
  """
969
1055
  ...
970
1056
 
971
1057
  @typing.overload
972
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
973
- ...
974
-
975
- @typing.overload
976
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
977
- ...
978
-
979
- 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):
980
- """
981
- Specifies the PyPI packages for the step.
982
-
983
- Information in this decorator will augment any
984
- attributes set in the `@pyi_base` flow-level decorator. Hence,
985
- you can use `@pypi_base` to set packages required by all
986
- steps and use `@pypi` to specify step-specific overrides.
987
-
988
- Parameters
989
- ----------
990
- packages : Dict[str, str], default: {}
991
- Packages to use for this step. The key is the name of the package
992
- and the value is the version to use.
993
- python : str, optional, default: None
994
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
995
- that the version used will correspond to the version of the Python interpreter used to start the run.
996
- """
997
- ...
998
-
999
- 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]]:
1000
- """
1001
- 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)
1002
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1003
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1004
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1005
- starts only after all sensors finish.
1006
-
1007
- Parameters
1008
- ----------
1009
- timeout : int
1010
- Time, in seconds before the task times out and fails. (Default: 3600)
1011
- poke_interval : int
1012
- Time in seconds that the job should wait in between each try. (Default: 60)
1013
- mode : str
1014
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1015
- exponential_backoff : bool
1016
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1017
- pool : str
1018
- the slot pool this task should run in,
1019
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1020
- soft_fail : bool
1021
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1022
- name : str
1023
- Name of the sensor on Airflow
1024
- description : str
1025
- Description of sensor in the Airflow UI
1026
- bucket_key : Union[str, List[str]]
1027
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1028
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1029
- bucket_name : str
1030
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1031
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1032
- wildcard_match : bool
1033
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1034
- aws_conn_id : str
1035
- a reference to the s3 connection on Airflow. (Default: None)
1036
- verify : bool
1037
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1038
- """
1039
- ...
1040
-
1041
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1042
- """
1043
- Specifies what flows belong to the same project.
1044
-
1045
- A project-specific namespace is created for all flows that
1046
- use the same `@project(name)`.
1047
-
1048
- Parameters
1049
- ----------
1050
- name : str
1051
- Project name. Make sure that the name is unique amongst all
1052
- projects that use the same production scheduler. The name may
1053
- contain only lowercase alphanumeric characters and underscores.
1054
-
1055
-
1056
- """
1057
- ...
1058
-
1059
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1060
- """
1061
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1062
-
1063
- User code call
1064
- -----------
1065
- @nim(
1066
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1067
- backend='managed'
1068
- )
1069
-
1070
- Valid backend options
1071
- ---------------------
1072
- - 'managed': Outerbounds selects a compute provider based on the model.
1073
- - 🚧 'dataplane': Run in your account.
1074
-
1075
- Valid model options
1076
- ----------------
1077
- - 'meta/llama3-8b-instruct': 8B parameter model
1078
- - 'meta/llama3-70b-instruct': 70B parameter model
1079
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1080
-
1081
- Parameters
1082
- ----------
1083
- models: list[NIM]
1084
- List of NIM containers running models in sidecars.
1085
- backend: str
1086
- Compute provider to run the NIM container.
1087
- """
1058
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1088
1059
  ...
1089
1060
 
1090
- @typing.overload
1091
- 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]]:
1061
+ 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):
1092
1062
  """
1093
- Specifies the flow(s) that this flow depends on.
1094
-
1095
- ```
1096
- @trigger_on_finish(flow='FooFlow')
1097
- ```
1098
- or
1099
- ```
1100
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1101
- ```
1102
- This decorator respects the @project decorator and triggers the flow
1103
- when upstream runs within the same namespace complete successfully
1104
-
1105
- Additionally, you can specify project aware upstream flow dependencies
1106
- by specifying the fully qualified project_flow_name.
1107
- ```
1108
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1109
- ```
1110
- or
1111
- ```
1112
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1113
- ```
1114
-
1115
- You can also specify just the project or project branch (other values will be
1116
- inferred from the current project or project branch):
1117
- ```
1118
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1119
- ```
1120
-
1121
- Note that `branch` is typically one of:
1122
- - `prod`
1123
- - `user.bob`
1124
- - `test.my_experiment`
1125
- - `prod.staging`
1063
+ Specifies the times when the flow should be run when running on a
1064
+ production scheduler.
1126
1065
 
1127
1066
  Parameters
1128
1067
  ----------
1129
- flow : Union[str, Dict[str, str]], optional, default None
1130
- Upstream flow dependency for this flow.
1131
- flows : List[Union[str, Dict[str, str]]], default []
1132
- Upstream flow dependencies for this flow.
1133
- options : Dict[str, Any], default {}
1134
- Backend-specific configuration for tuning eventing behavior.
1135
-
1136
-
1068
+ hourly : bool, default False
1069
+ Run the workflow hourly.
1070
+ daily : bool, default True
1071
+ Run the workflow daily.
1072
+ weekly : bool, default False
1073
+ Run the workflow weekly.
1074
+ cron : str, optional, default None
1075
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1076
+ specified by this expression.
1077
+ timezone : str, optional, default None
1078
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1079
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1137
1080
  """
1138
1081
  ...
1139
1082
 
1140
1083
  @typing.overload
1141
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1142
- ...
1143
-
1144
- 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] = {}):
1084
+ def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1145
1085
  """
1146
- Specifies the flow(s) that this flow depends on.
1147
-
1148
- ```
1149
- @trigger_on_finish(flow='FooFlow')
1150
- ```
1151
- or
1152
- ```
1153
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1154
- ```
1155
- This decorator respects the @project decorator and triggers the flow
1156
- when upstream runs within the same namespace complete successfully
1157
-
1158
- Additionally, you can specify project aware upstream flow dependencies
1159
- by specifying the fully qualified project_flow_name.
1160
- ```
1161
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1162
- ```
1163
- or
1164
- ```
1165
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1166
- ```
1167
-
1168
- You can also specify just the project or project branch (other values will be
1169
- inferred from the current project or project branch):
1170
- ```
1171
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1172
- ```
1173
-
1174
- Note that `branch` is typically one of:
1175
- - `prod`
1176
- - `user.bob`
1177
- - `test.my_experiment`
1178
- - `prod.staging`
1179
-
1180
- Parameters
1181
- ----------
1182
- flow : Union[str, Dict[str, str]], optional, default None
1183
- Upstream flow dependency for this flow.
1184
- flows : List[Union[str, Dict[str, str]]], default []
1185
- Upstream flow dependencies for this flow.
1186
- options : Dict[str, Any], default {}
1187
- Backend-specific configuration for tuning eventing behavior.
1188
-
1086
+ Specifies the Conda environment for all steps of the flow.
1189
1087
 
1190
- """
1191
- ...
1192
-
1193
- @typing.overload
1194
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1195
- """
1196
- Specifies the PyPI packages for all steps of the flow.
1088
+ Use `@conda_base` to set common libraries required by all
1089
+ steps and use `@conda` to specify step-specific additions.
1197
1090
 
1198
- Use `@pypi_base` to set common packages required by all
1199
- steps and use `@pypi` to specify step-specific overrides.
1200
1091
  Parameters
1201
1092
  ----------
1202
- packages : Dict[str, str], default: {}
1093
+ packages : Dict[str, str], default {}
1203
1094
  Packages to use for this flow. The key is the name of the package
1204
1095
  and the value is the version to use.
1205
- python : str, optional, default: None
1096
+ libraries : Dict[str, str], default {}
1097
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1098
+ python : str, optional, default None
1206
1099
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1207
1100
  that the version used will correspond to the version of the Python interpreter used to start the run.
1101
+ disabled : bool, default False
1102
+ If set to True, disables Conda.
1208
1103
  """
1209
1104
  ...
1210
1105
 
1211
1106
  @typing.overload
1212
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1107
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1213
1108
  ...
1214
1109
 
1215
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1110
+ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1216
1111
  """
1217
- Specifies the PyPI packages for all steps of the flow.
1112
+ Specifies the Conda environment for all steps of the flow.
1113
+
1114
+ Use `@conda_base` to set common libraries required by all
1115
+ steps and use `@conda` to specify step-specific additions.
1218
1116
 
1219
- Use `@pypi_base` to set common packages required by all
1220
- steps and use `@pypi` to specify step-specific overrides.
1221
1117
  Parameters
1222
1118
  ----------
1223
- packages : Dict[str, str], default: {}
1119
+ packages : Dict[str, str], default {}
1224
1120
  Packages to use for this flow. The key is the name of the package
1225
1121
  and the value is the version to use.
1226
- python : str, optional, default: None
1122
+ libraries : Dict[str, str], default {}
1123
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1124
+ python : str, optional, default None
1227
1125
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1228
1126
  that the version used will correspond to the version of the Python interpreter used to start the run.
1127
+ disabled : bool, default False
1128
+ If set to True, disables Conda.
1229
1129
  """
1230
1130
  ...
1231
1131
 
@@ -1271,52 +1171,34 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1271
1171
  """
1272
1172
  ...
1273
1173
 
1274
- @typing.overload
1275
- def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1174
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1276
1175
  """
1277
- Specifies the Conda environment for all steps of the flow.
1176
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1278
1177
 
1279
- Use `@conda_base` to set common libraries required by all
1280
- steps and use `@conda` to specify step-specific additions.
1178
+ User code call
1179
+ -----------
1180
+ @nim(
1181
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1182
+ backend='managed'
1183
+ )
1281
1184
 
1282
- Parameters
1283
- ----------
1284
- packages : Dict[str, str], default {}
1285
- Packages to use for this flow. The key is the name of the package
1286
- and the value is the version to use.
1287
- libraries : Dict[str, str], default {}
1288
- Supported for backward compatibility. When used with packages, packages will take precedence.
1289
- python : str, optional, default None
1290
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1291
- that the version used will correspond to the version of the Python interpreter used to start the run.
1292
- disabled : bool, default False
1293
- If set to True, disables Conda.
1294
- """
1295
- ...
1296
-
1297
- @typing.overload
1298
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1299
- ...
1300
-
1301
- def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1302
- """
1303
- Specifies the Conda environment for all steps of the flow.
1185
+ Valid backend options
1186
+ ---------------------
1187
+ - 'managed': Outerbounds selects a compute provider based on the model.
1188
+ - 🚧 'dataplane': Run in your account.
1304
1189
 
1305
- Use `@conda_base` to set common libraries required by all
1306
- steps and use `@conda` to specify step-specific additions.
1190
+ Valid model options
1191
+ ----------------
1192
+ - 'meta/llama3-8b-instruct': 8B parameter model
1193
+ - 'meta/llama3-70b-instruct': 70B parameter model
1194
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1307
1195
 
1308
1196
  Parameters
1309
1197
  ----------
1310
- packages : Dict[str, str], default {}
1311
- Packages to use for this flow. The key is the name of the package
1312
- and the value is the version to use.
1313
- libraries : Dict[str, str], default {}
1314
- Supported for backward compatibility. When used with packages, packages will take precedence.
1315
- python : str, optional, default None
1316
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1317
- that the version used will correspond to the version of the Python interpreter used to start the run.
1318
- disabled : bool, default False
1319
- If set to True, disables Conda.
1198
+ models: list[NIM]
1199
+ List of NIM containers running models in sidecars.
1200
+ backend: str
1201
+ Compute provider to run the NIM container.
1320
1202
  """
1321
1203
  ...
1322
1204
 
@@ -1415,52 +1297,166 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1415
1297
  """
1416
1298
  ...
1417
1299
 
1300
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1301
+ """
1302
+ Specifies what flows belong to the same project.
1303
+
1304
+ A project-specific namespace is created for all flows that
1305
+ use the same `@project(name)`.
1306
+
1307
+ Parameters
1308
+ ----------
1309
+ name : str
1310
+ Project name. Make sure that the name is unique amongst all
1311
+ projects that use the same production scheduler. The name may
1312
+ contain only lowercase alphanumeric characters and underscores.
1313
+
1314
+
1315
+ """
1316
+ ...
1317
+
1318
+ 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]]:
1319
+ """
1320
+ 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)
1321
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1322
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1323
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1324
+ starts only after all sensors finish.
1325
+
1326
+ Parameters
1327
+ ----------
1328
+ timeout : int
1329
+ Time, in seconds before the task times out and fails. (Default: 3600)
1330
+ poke_interval : int
1331
+ Time in seconds that the job should wait in between each try. (Default: 60)
1332
+ mode : str
1333
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1334
+ exponential_backoff : bool
1335
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1336
+ pool : str
1337
+ the slot pool this task should run in,
1338
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1339
+ soft_fail : bool
1340
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1341
+ name : str
1342
+ Name of the sensor on Airflow
1343
+ description : str
1344
+ Description of sensor in the Airflow UI
1345
+ bucket_key : Union[str, List[str]]
1346
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1347
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1348
+ bucket_name : str
1349
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1350
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1351
+ wildcard_match : bool
1352
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1353
+ aws_conn_id : str
1354
+ a reference to the s3 connection on Airflow. (Default: None)
1355
+ verify : bool
1356
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1357
+ """
1358
+ ...
1359
+
1418
1360
  @typing.overload
1419
- 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]]:
1361
+ 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]]:
1420
1362
  """
1421
- Specifies the times when the flow should be run when running on a
1422
- production scheduler.
1363
+ Specifies the flow(s) that this flow depends on.
1364
+
1365
+ ```
1366
+ @trigger_on_finish(flow='FooFlow')
1367
+ ```
1368
+ or
1369
+ ```
1370
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1371
+ ```
1372
+ This decorator respects the @project decorator and triggers the flow
1373
+ when upstream runs within the same namespace complete successfully
1374
+
1375
+ Additionally, you can specify project aware upstream flow dependencies
1376
+ by specifying the fully qualified project_flow_name.
1377
+ ```
1378
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1379
+ ```
1380
+ or
1381
+ ```
1382
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1383
+ ```
1384
+
1385
+ You can also specify just the project or project branch (other values will be
1386
+ inferred from the current project or project branch):
1387
+ ```
1388
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1389
+ ```
1390
+
1391
+ Note that `branch` is typically one of:
1392
+ - `prod`
1393
+ - `user.bob`
1394
+ - `test.my_experiment`
1395
+ - `prod.staging`
1423
1396
 
1424
1397
  Parameters
1425
1398
  ----------
1426
- hourly : bool, default False
1427
- Run the workflow hourly.
1428
- daily : bool, default True
1429
- Run the workflow daily.
1430
- weekly : bool, default False
1431
- Run the workflow weekly.
1432
- cron : str, optional, default None
1433
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1434
- specified by this expression.
1435
- timezone : str, optional, default None
1436
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1437
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1399
+ flow : Union[str, Dict[str, str]], optional, default None
1400
+ Upstream flow dependency for this flow.
1401
+ flows : List[Union[str, Dict[str, str]]], default []
1402
+ Upstream flow dependencies for this flow.
1403
+ options : Dict[str, Any], default {}
1404
+ Backend-specific configuration for tuning eventing behavior.
1405
+
1406
+
1438
1407
  """
1439
1408
  ...
1440
1409
 
1441
1410
  @typing.overload
1442
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1411
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1443
1412
  ...
1444
1413
 
1445
- 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):
1414
+ 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] = {}):
1446
1415
  """
1447
- Specifies the times when the flow should be run when running on a
1448
- production scheduler.
1416
+ Specifies the flow(s) that this flow depends on.
1417
+
1418
+ ```
1419
+ @trigger_on_finish(flow='FooFlow')
1420
+ ```
1421
+ or
1422
+ ```
1423
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1424
+ ```
1425
+ This decorator respects the @project decorator and triggers the flow
1426
+ when upstream runs within the same namespace complete successfully
1427
+
1428
+ Additionally, you can specify project aware upstream flow dependencies
1429
+ by specifying the fully qualified project_flow_name.
1430
+ ```
1431
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1432
+ ```
1433
+ or
1434
+ ```
1435
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1436
+ ```
1437
+
1438
+ You can also specify just the project or project branch (other values will be
1439
+ inferred from the current project or project branch):
1440
+ ```
1441
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1442
+ ```
1443
+
1444
+ Note that `branch` is typically one of:
1445
+ - `prod`
1446
+ - `user.bob`
1447
+ - `test.my_experiment`
1448
+ - `prod.staging`
1449
1449
 
1450
1450
  Parameters
1451
1451
  ----------
1452
- hourly : bool, default False
1453
- Run the workflow hourly.
1454
- daily : bool, default True
1455
- Run the workflow daily.
1456
- weekly : bool, default False
1457
- Run the workflow weekly.
1458
- cron : str, optional, default None
1459
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1460
- specified by this expression.
1461
- timezone : str, optional, default None
1462
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1463
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1452
+ flow : Union[str, Dict[str, str]], optional, default None
1453
+ Upstream flow dependency for this flow.
1454
+ flows : List[Union[str, Dict[str, str]]], default []
1455
+ Upstream flow dependencies for this flow.
1456
+ options : Dict[str, Any], default {}
1457
+ Backend-specific configuration for tuning eventing behavior.
1458
+
1459
+
1464
1460
  """
1465
1461
  ...
1466
1462
 
@@ -2642,6 +2638,8 @@ class NBDeployer(object, metaclass=type):
2642
2638
  ...
2643
2639
  ...
2644
2640
 
2641
+ pkg_name: str
2642
+
2645
2643
  def get_aws_client(module, with_error = False, role_arn = None, session_vars = None, client_params = None):
2646
2644
  ...
2647
2645