ob-metaflow-stubs 6.0.3.112rc0__py2.py3-none-any.whl → 6.0.3.113__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 +629 -629
  2. metaflow-stubs/cards.pyi +3 -3
  3. metaflow-stubs/cli.pyi +3 -3
  4. metaflow-stubs/client/__init__.pyi +4 -4
  5. metaflow-stubs/client/core.pyi +6 -6
  6. metaflow-stubs/client/filecache.pyi +3 -3
  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 +4 -4
  13. metaflow-stubs/info_file.pyi +2 -2
  14. metaflow-stubs/metadata/metadata.pyi +3 -3
  15. metaflow-stubs/metadata/util.pyi +2 -2
  16. metaflow-stubs/metaflow_config.pyi +2 -2
  17. metaflow-stubs/metaflow_current.pyi +101 -101
  18. metaflow-stubs/mflog/mflog.pyi +2 -2
  19. metaflow-stubs/multicore_utils.pyi +2 -2
  20. metaflow-stubs/parameters.pyi +3 -3
  21. metaflow-stubs/plugins/__init__.pyi +3 -3
  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 +3 -3
  27. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +4 -4
  28. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +4 -4
  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 +3 -3
  33. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +7 -7
  34. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +6 -6
  35. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
  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 +3 -3
  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 +2 -2
  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 +2 -2
  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 +3 -3
  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 +3 -3
  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 +3 -3
  97. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
  98. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  99. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  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 +5 -5
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  120. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  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 +4 -4
  132. metaflow-stubs/system/system_logger.pyi +3 -3
  133. metaflow-stubs/system/system_monitor.pyi +3 -3
  134. metaflow-stubs/tagging_util.pyi +2 -2
  135. metaflow-stubs/tuple_util.pyi +2 -2
  136. {ob_metaflow_stubs-6.0.3.112rc0.dist-info → ob_metaflow_stubs-6.0.3.113.dist-info}/METADATA +1 -1
  137. ob_metaflow_stubs-6.0.3.113.dist-info/RECORD +140 -0
  138. ob_metaflow_stubs-6.0.3.112rc0.dist-info/RECORD +0 -140
  139. {ob_metaflow_stubs-6.0.3.112rc0.dist-info → ob_metaflow_stubs-6.0.3.113.dist-info}/WHEEL +0 -0
  140. {ob_metaflow_stubs-6.0.3.112rc0.dist-info → ob_metaflow_stubs-6.0.3.113.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,24 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.25.2+obcheckpoint(0.1.0);ob(v1) #
4
- # Generated on 2024-10-21T18:58:32.974120 #
3
+ # MF version: 2.12.25.2+obcheckpoint(0.1.1);ob(v1) #
4
+ # Generated on 2024-10-22T22:37:22.374436 #
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.metaflow_current
12
- import metaflow.parameters
11
+ import datetime
13
12
  import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
13
+ import metaflow.datastore.inputs
14
+ import metaflow.parameters
14
15
  import metaflow.flowspec
15
16
  import typing
16
- import metaflow.events
17
- import datetime
18
- import metaflow.client.core
19
- import metaflow.datastore.inputs
20
17
  import metaflow._vendor.click.types
18
+ import metaflow.client.core
19
+ import metaflow.metaflow_current
21
20
  import metaflow.runner.metaflow_runner
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
 
@@ -513,59 +513,102 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
513
513
  ...
514
514
 
515
515
  @typing.overload
516
- 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]]]:
516
+ 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]]]:
517
517
  """
518
- Specifies a timeout for your step.
519
-
520
- This decorator is useful if this step may hang indefinitely.
521
-
522
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
523
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
524
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
518
+ Specifies that the step will success under all circumstances.
525
519
 
526
- Note that all the values specified in parameters are added together so if you specify
527
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
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.
528
524
 
529
525
  Parameters
530
526
  ----------
531
- seconds : int, default 0
532
- Number of seconds to wait prior to timing out.
533
- minutes : int, default 0
534
- Number of minutes to wait prior to timing out.
535
- hours : int, default 0
536
- Number of hours to wait prior to timing out.
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.
537
533
  """
538
534
  ...
539
535
 
540
536
  @typing.overload
541
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
537
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
542
538
  ...
543
539
 
544
540
  @typing.overload
545
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
541
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
546
542
  ...
547
543
 
548
- 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):
544
+ 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):
549
545
  """
550
- Specifies a timeout for your step.
546
+ Specifies that the step will success under all circumstances.
551
547
 
552
- This decorator is useful if this step may hang indefinitely.
548
+ The decorator will create an optional artifact, specified by `var`, which
549
+ contains the exception raised. You can use it to detect the presence
550
+ of errors, indicating that all happy-path artifacts produced by the step
551
+ are missing.
553
552
 
554
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
555
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
556
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
553
+ Parameters
554
+ ----------
555
+ var : str, optional, default None
556
+ Name of the artifact in which to store the caught exception.
557
+ If not specified, the exception is not stored.
558
+ print_exception : bool, default True
559
+ Determines whether or not the exception is printed to
560
+ stdout when caught.
561
+ """
562
+ ...
563
+
564
+ @typing.overload
565
+ 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]]]:
566
+ """
567
+ Creates a human-readable report, a Metaflow Card, after this step completes.
557
568
 
558
- Note that all the values specified in parameters are added together so if you specify
559
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
569
+ Note that you may add multiple `@card` decorators in a step with different parameters.
560
570
 
561
571
  Parameters
562
572
  ----------
563
- seconds : int, default 0
564
- Number of seconds to wait prior to timing out.
565
- minutes : int, default 0
566
- Number of minutes to wait prior to timing out.
567
- hours : int, default 0
568
- Number of hours to wait prior to timing out.
573
+ type : str, default 'default'
574
+ Card type.
575
+ id : str, optional, default None
576
+ If multiple cards are present, use this id to identify this card.
577
+ options : Dict[str, Any], default {}
578
+ Options passed to the card. The contents depend on the card type.
579
+ timeout : int, default 45
580
+ Interrupt reporting if it takes more than this many seconds.
581
+
582
+
583
+ """
584
+ ...
585
+
586
+ @typing.overload
587
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
588
+ ...
589
+
590
+ @typing.overload
591
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
592
+ ...
593
+
594
+ 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):
595
+ """
596
+ Creates a human-readable report, a Metaflow Card, after this step completes.
597
+
598
+ Note that you may add multiple `@card` decorators in a step with different parameters.
599
+
600
+ Parameters
601
+ ----------
602
+ type : str, default 'default'
603
+ Card type.
604
+ id : str, optional, default None
605
+ If multiple cards are present, use this id to identify this card.
606
+ options : Dict[str, Any], default {}
607
+ Options passed to the card. The contents depend on the card type.
608
+ timeout : int, default 45
609
+ Interrupt reporting if it takes more than this many seconds.
610
+
611
+
569
612
  """
570
613
  ...
571
614
 
@@ -623,26 +666,45 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
623
666
  ...
624
667
 
625
668
  @typing.overload
626
- 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]]]:
669
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
627
670
  """
628
- Enables checkpointing for a step.
671
+ Decorator prototype for all step decorators. This function gets specialized
672
+ and imported for all decorators types by _import_plugin_decorators().
673
+ """
674
+ ...
675
+
676
+ @typing.overload
677
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
678
+ ...
679
+
680
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
681
+ """
682
+ Decorator prototype for all step decorators. This function gets specialized
683
+ and imported for all decorators types by _import_plugin_decorators().
684
+ """
685
+ ...
686
+
687
+ @typing.overload
688
+ 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]]]:
689
+ """
690
+ Enables loading / saving of models within a step.
629
691
 
630
692
 
631
693
  Parameters
632
694
  ----------
633
- load_policy : str, default: "fresh"
634
- The policy for loading the checkpoint. The following policies are supported:
635
- - "eager": Loads the the latest available checkpoint within the namespace.
636
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
637
- will be loaded at the start of the task.
638
- - "none": Do not load any checkpoint
639
- - "fresh": Loads the lastest checkpoint created within the running Task.
640
- This mode helps loading checkpoints across various retry attempts of the same task.
641
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
642
- created within the task will be loaded when the task is retries execution on failure.
695
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
696
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
697
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
698
+ - `current.checkpoint`
699
+ - `current.model`
700
+ - `current.huggingface_hub`
701
+
702
+ 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
703
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
704
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
643
705
 
644
706
  temp_dir_root : str, default: None
645
- The root directory under which `current.checkpoint.directory` will be created.
707
+ The root directory under which `current.model.loaded` will store loaded models
646
708
 
647
709
 
648
710
 
@@ -650,33 +712,33 @@ def checkpoint(*, load_policy: str = "fresh", temp_dir_root: str = None) -> typi
650
712
  ...
651
713
 
652
714
  @typing.overload
653
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
715
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
654
716
  ...
655
717
 
656
718
  @typing.overload
657
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
719
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
658
720
  ...
659
721
 
660
- 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):
722
+ 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):
661
723
  """
662
- Enables checkpointing for a step.
724
+ Enables loading / saving of models within a step.
663
725
 
664
726
 
665
727
  Parameters
666
728
  ----------
667
- load_policy : str, default: "fresh"
668
- The policy for loading the checkpoint. The following policies are supported:
669
- - "eager": Loads the the latest available checkpoint within the namespace.
670
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
671
- will be loaded at the start of the task.
672
- - "none": Do not load any checkpoint
673
- - "fresh": Loads the lastest checkpoint created within the running Task.
674
- This mode helps loading checkpoints across various retry attempts of the same task.
675
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
676
- created within the task will be loaded when the task is retries execution on failure.
729
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
730
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
731
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
732
+ - `current.checkpoint`
733
+ - `current.model`
734
+ - `current.huggingface_hub`
735
+
736
+ 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
737
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
738
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
677
739
 
678
740
  temp_dir_root : str, default: None
679
- The root directory under which `current.checkpoint.directory` will be created.
741
+ The root directory under which `current.model.loaded` will store loaded models
680
742
 
681
743
 
682
744
 
@@ -684,119 +746,42 @@ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
684
746
  ...
685
747
 
686
748
  @typing.overload
687
- 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]]]:
749
+ 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]]]:
688
750
  """
689
- Specifies the resources needed when executing this step.
690
-
691
- Use `@resources` to specify the resource requirements
692
- independently of the specific compute layer (`@batch`, `@kubernetes`).
751
+ Specifies the PyPI packages for the step.
693
752
 
694
- You can choose the compute layer on the command line by executing e.g.
695
- ```
696
- python myflow.py run --with batch
697
- ```
698
- or
699
- ```
700
- python myflow.py run --with kubernetes
701
- ```
702
- which executes the flow on the desired system using the
703
- requirements specified in `@resources`.
753
+ Information in this decorator will augment any
754
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
755
+ you can use `@pypi_base` to set packages required by all
756
+ steps and use `@pypi` to specify step-specific overrides.
704
757
 
705
758
  Parameters
706
759
  ----------
707
- cpu : int, default 1
708
- Number of CPUs required for this step.
709
- gpu : int, default 0
710
- Number of GPUs required for this step.
711
- disk : int, optional, default None
712
- Disk size (in MB) required for this step. Only applies on Kubernetes.
713
- memory : int, default 4096
714
- Memory size (in MB) required for this step.
715
- shared_memory : int, optional, default None
716
- The value for the size (in MiB) of the /dev/shm volume for this step.
717
- This parameter maps to the `--shm-size` option in Docker.
760
+ packages : Dict[str, str], default: {}
761
+ Packages to use for this step. The key is the name of the package
762
+ and the value is the version to use.
763
+ python : str, optional, default: None
764
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
765
+ that the version used will correspond to the version of the Python interpreter used to start the run.
718
766
  """
719
767
  ...
720
768
 
721
769
  @typing.overload
722
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
770
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
723
771
  ...
724
772
 
725
773
  @typing.overload
726
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
774
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
727
775
  ...
728
776
 
729
- 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):
777
+ 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):
730
778
  """
731
- Specifies the resources needed when executing this step.
779
+ Specifies the PyPI packages for the step.
732
780
 
733
- Use `@resources` to specify the resource requirements
734
- independently of the specific compute layer (`@batch`, `@kubernetes`).
735
-
736
- You can choose the compute layer on the command line by executing e.g.
737
- ```
738
- python myflow.py run --with batch
739
- ```
740
- or
741
- ```
742
- python myflow.py run --with kubernetes
743
- ```
744
- which executes the flow on the desired system using the
745
- requirements specified in `@resources`.
746
-
747
- Parameters
748
- ----------
749
- cpu : int, default 1
750
- Number of CPUs required for this step.
751
- gpu : int, default 0
752
- Number of GPUs required for this step.
753
- disk : int, optional, default None
754
- Disk size (in MB) required for this step. Only applies on Kubernetes.
755
- memory : int, default 4096
756
- Memory size (in MB) required for this step.
757
- shared_memory : int, optional, default None
758
- The value for the size (in MiB) of the /dev/shm volume for this step.
759
- This parameter maps to the `--shm-size` option in Docker.
760
- """
761
- ...
762
-
763
- @typing.overload
764
- 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]]]:
765
- """
766
- Specifies the PyPI packages for the step.
767
-
768
- Information in this decorator will augment any
769
- attributes set in the `@pyi_base` flow-level decorator. Hence,
770
- you can use `@pypi_base` to set packages required by all
771
- steps and use `@pypi` to specify step-specific overrides.
772
-
773
- Parameters
774
- ----------
775
- packages : Dict[str, str], default: {}
776
- Packages to use for this step. The key is the name of the package
777
- and the value is the version to use.
778
- python : str, optional, default: None
779
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
780
- that the version used will correspond to the version of the Python interpreter used to start the run.
781
- """
782
- ...
783
-
784
- @typing.overload
785
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
786
- ...
787
-
788
- @typing.overload
789
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
790
- ...
791
-
792
- 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):
793
- """
794
- Specifies the PyPI packages for the step.
795
-
796
- Information in this decorator will augment any
797
- attributes set in the `@pyi_base` flow-level decorator. Hence,
798
- you can use `@pypi_base` to set packages required by all
799
- steps and use `@pypi` to specify step-specific overrides.
781
+ Information in this decorator will augment any
782
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
783
+ you can use `@pypi_base` to set packages required by all
784
+ steps and use `@pypi` to specify step-specific overrides.
800
785
 
801
786
  Parameters
802
787
  ----------
@@ -810,127 +795,92 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
810
795
  ...
811
796
 
812
797
  @typing.overload
813
- 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]]]:
798
+ 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]]]:
814
799
  """
815
- Specifies the Conda environment for the step.
816
-
817
- Information in this decorator will augment any
818
- attributes set in the `@conda_base` flow-level decorator. Hence,
819
- you can use `@conda_base` to set packages required by all
820
- steps and use `@conda` to specify step-specific overrides.
800
+ Specifies secrets to be retrieved and injected as environment variables prior to
801
+ the execution of a step.
821
802
 
822
803
  Parameters
823
804
  ----------
824
- packages : Dict[str, str], default {}
825
- Packages to use for this step. The key is the name of the package
826
- and the value is the version to use.
827
- libraries : Dict[str, str], default {}
828
- Supported for backward compatibility. When used with packages, packages will take precedence.
829
- python : str, optional, default None
830
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
831
- that the version used will correspond to the version of the Python interpreter used to start the run.
832
- disabled : bool, default False
833
- If set to True, disables @conda.
805
+ sources : List[Union[str, Dict[str, Any]]], default: []
806
+ List of secret specs, defining how the secrets are to be retrieved
834
807
  """
835
808
  ...
836
809
 
837
810
  @typing.overload
838
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
811
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
839
812
  ...
840
813
 
841
814
  @typing.overload
842
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
815
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
843
816
  ...
844
817
 
845
- 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):
818
+ 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]]] = []):
846
819
  """
847
- Specifies the Conda environment for the step.
848
-
849
- Information in this decorator will augment any
850
- attributes set in the `@conda_base` flow-level decorator. Hence,
851
- you can use `@conda_base` to set packages required by all
852
- steps and use `@conda` to specify step-specific overrides.
820
+ Specifies secrets to be retrieved and injected as environment variables prior to
821
+ the execution of a step.
853
822
 
854
823
  Parameters
855
824
  ----------
856
- packages : Dict[str, str], default {}
857
- Packages to use for this step. The key is the name of the package
858
- and the value is the version to use.
859
- libraries : Dict[str, str], default {}
860
- Supported for backward compatibility. When used with packages, packages will take precedence.
861
- python : str, optional, default None
862
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
863
- that the version used will correspond to the version of the Python interpreter used to start the run.
864
- disabled : bool, default False
865
- If set to True, disables @conda.
825
+ sources : List[Union[str, Dict[str, Any]]], default: []
826
+ List of secret specs, defining how the secrets are to be retrieved
866
827
  """
867
828
  ...
868
829
 
869
830
  @typing.overload
870
- 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]]]:
831
+ 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]]]:
871
832
  """
872
- Creates a human-readable report, a Metaflow Card, after this step completes.
833
+ Specifies a timeout for your step.
873
834
 
874
- Note that you may add multiple `@card` decorators in a step with different parameters.
835
+ This decorator is useful if this step may hang indefinitely.
875
836
 
876
- Parameters
877
- ----------
878
- type : str, default 'default'
879
- Card type.
880
- id : str, optional, default None
881
- If multiple cards are present, use this id to identify this card.
882
- options : Dict[str, Any], default {}
883
- Options passed to the card. The contents depend on the card type.
884
- timeout : int, default 45
885
- Interrupt reporting if it takes more than this many seconds.
837
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
838
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
839
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
886
840
 
841
+ Note that all the values specified in parameters are added together so if you specify
842
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
887
843
 
844
+ Parameters
845
+ ----------
846
+ seconds : int, default 0
847
+ Number of seconds to wait prior to timing out.
848
+ minutes : int, default 0
849
+ Number of minutes to wait prior to timing out.
850
+ hours : int, default 0
851
+ Number of hours to wait prior to timing out.
888
852
  """
889
853
  ...
890
854
 
891
855
  @typing.overload
892
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
856
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
893
857
  ...
894
858
 
895
859
  @typing.overload
896
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
860
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
897
861
  ...
898
862
 
899
- 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):
863
+ 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):
900
864
  """
901
- Creates a human-readable report, a Metaflow Card, after this step completes.
865
+ Specifies a timeout for your step.
902
866
 
903
- Note that you may add multiple `@card` decorators in a step with different parameters.
867
+ This decorator is useful if this step may hang indefinitely.
904
868
 
905
- Parameters
906
- ----------
907
- type : str, default 'default'
908
- Card type.
909
- id : str, optional, default None
910
- If multiple cards are present, use this id to identify this card.
911
- options : Dict[str, Any], default {}
912
- Options passed to the card. The contents depend on the card type.
913
- timeout : int, default 45
914
- Interrupt reporting if it takes more than this many seconds.
869
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
870
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
871
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
915
872
 
873
+ Note that all the values specified in parameters are added together so if you specify
874
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
916
875
 
917
- """
918
- ...
919
-
920
- @typing.overload
921
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
922
- """
923
- Internal decorator to support Fast bakery
924
- """
925
- ...
926
-
927
- @typing.overload
928
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
929
- ...
930
-
931
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
932
- """
933
- Internal decorator to support Fast bakery
876
+ Parameters
877
+ ----------
878
+ seconds : int, default 0
879
+ Number of seconds to wait prior to timing out.
880
+ minutes : int, default 0
881
+ Number of minutes to wait prior to timing out.
882
+ hours : int, default 0
883
+ Number of hours to wait prior to timing out.
934
884
  """
935
885
  ...
936
886
 
@@ -1001,233 +951,371 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
1001
951
  ...
1002
952
 
1003
953
  @typing.overload
1004
- 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]]]:
954
+ 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]]]:
1005
955
  """
1006
- Enables loading / saving of models within a step.
1007
-
956
+ Specifies environment variables to be set prior to the execution of a step.
1008
957
 
1009
958
  Parameters
1010
959
  ----------
1011
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
1012
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
1013
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
1014
- - `current.checkpoint`
1015
- - `current.model`
1016
- - `current.huggingface_hub`
1017
-
1018
- 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
1019
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
1020
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
1021
-
1022
- temp_dir_root : str, default: None
1023
- The root directory under which `current.model.loaded` will store loaded models
1024
-
1025
-
1026
-
960
+ vars : Dict[str, str], default {}
961
+ Dictionary of environment variables to set.
1027
962
  """
1028
963
  ...
1029
964
 
1030
965
  @typing.overload
1031
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
966
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1032
967
  ...
1033
968
 
1034
969
  @typing.overload
1035
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
970
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1036
971
  ...
1037
972
 
1038
- 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):
973
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1039
974
  """
1040
- Enables loading / saving of models within a step.
1041
-
975
+ Specifies environment variables to be set prior to the execution of a step.
1042
976
 
1043
977
  Parameters
1044
978
  ----------
1045
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
1046
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
1047
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
1048
- - `current.checkpoint`
1049
- - `current.model`
1050
- - `current.huggingface_hub`
1051
-
1052
- 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
1053
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
1054
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
1055
-
1056
- temp_dir_root : str, default: None
1057
- The root directory under which `current.model.loaded` will store loaded models
1058
-
1059
-
1060
-
979
+ vars : Dict[str, str], default {}
980
+ Dictionary of environment variables to set.
1061
981
  """
1062
982
  ...
1063
983
 
1064
- def huggingface_hub(*, temp_dir_root: 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]]]:
984
+ @typing.overload
985
+ 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]]]:
1065
986
  """
1066
- Decorator that helps cache, version and store models/datasets from huggingface hub.
987
+ Specifies the Conda environment for the step.
988
+
989
+ Information in this decorator will augment any
990
+ attributes set in the `@conda_base` flow-level decorator. Hence,
991
+ you can use `@conda_base` to set packages required by all
992
+ steps and use `@conda` to specify step-specific overrides.
1067
993
 
1068
994
  Parameters
1069
995
  ----------
1070
- temp_dir_root : str, optional
1071
- The root directory that will hold the temporary directory where objects will be downloaded.
1072
-
1073
-
996
+ packages : Dict[str, str], default {}
997
+ Packages to use for this step. The key is the name of the package
998
+ and the value is the version to use.
999
+ libraries : Dict[str, str], default {}
1000
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1001
+ python : str, optional, default None
1002
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1003
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1004
+ disabled : bool, default False
1005
+ If set to True, disables @conda.
1074
1006
  """
1075
1007
  ...
1076
1008
 
1077
1009
  @typing.overload
1078
- 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]]]:
1079
- """
1080
- Specifies secrets to be retrieved and injected as environment variables prior to
1081
- the execution of a step.
1082
-
1083
- Parameters
1084
- ----------
1085
- sources : List[Union[str, Dict[str, Any]]], default: []
1086
- List of secret specs, defining how the secrets are to be retrieved
1087
- """
1088
- ...
1089
-
1090
- @typing.overload
1091
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1010
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1092
1011
  ...
1093
1012
 
1094
1013
  @typing.overload
1095
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1014
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1096
1015
  ...
1097
1016
 
1098
- 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]]] = []):
1017
+ 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):
1099
1018
  """
1100
- Specifies secrets to be retrieved and injected as environment variables prior to
1101
- the execution of a step.
1019
+ Specifies the Conda environment for the step.
1020
+
1021
+ Information in this decorator will augment any
1022
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1023
+ you can use `@conda_base` to set packages required by all
1024
+ steps and use `@conda` to specify step-specific overrides.
1102
1025
 
1103
1026
  Parameters
1104
1027
  ----------
1105
- sources : List[Union[str, Dict[str, Any]]], default: []
1106
- List of secret specs, defining how the secrets are to be retrieved
1028
+ packages : Dict[str, str], default {}
1029
+ Packages to use for this step. The key is the name of the package
1030
+ and the value is the version to use.
1031
+ libraries : Dict[str, str], default {}
1032
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1033
+ python : str, optional, default None
1034
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1035
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1036
+ disabled : bool, default False
1037
+ If set to True, disables @conda.
1107
1038
  """
1108
1039
  ...
1109
1040
 
1110
1041
  @typing.overload
1111
- 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]]]:
1042
+ 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]]]:
1112
1043
  """
1113
- Specifies environment variables to be set prior to the execution of a step.
1044
+ Enables checkpointing for a step.
1045
+
1114
1046
 
1115
1047
  Parameters
1116
1048
  ----------
1117
- vars : Dict[str, str], default {}
1118
- Dictionary of environment variables to set.
1049
+ load_policy : str, default: "fresh"
1050
+ The policy for loading the checkpoint. The following policies are supported:
1051
+ - "eager": Loads the the latest available checkpoint within the namespace.
1052
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
1053
+ will be loaded at the start of the task.
1054
+ - "none": Do not load any checkpoint
1055
+ - "fresh": Loads the lastest checkpoint created within the running Task.
1056
+ This mode helps loading checkpoints across various retry attempts of the same task.
1057
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
1058
+ created within the task will be loaded when the task is retries execution on failure.
1059
+
1060
+ temp_dir_root : str, default: None
1061
+ The root directory under which `current.checkpoint.directory` will be created.
1062
+
1063
+
1064
+
1119
1065
  """
1120
1066
  ...
1121
1067
 
1122
1068
  @typing.overload
1123
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1069
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1124
1070
  ...
1125
1071
 
1126
1072
  @typing.overload
1127
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1073
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1128
1074
  ...
1129
1075
 
1130
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1076
+ 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):
1131
1077
  """
1132
- Specifies environment variables to be set prior to the execution of a step.
1078
+ Enables checkpointing for a step.
1079
+
1133
1080
 
1134
1081
  Parameters
1135
1082
  ----------
1136
- vars : Dict[str, str], default {}
1137
- Dictionary of environment variables to set.
1083
+ load_policy : str, default: "fresh"
1084
+ The policy for loading the checkpoint. The following policies are supported:
1085
+ - "eager": Loads the the latest available checkpoint within the namespace.
1086
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
1087
+ will be loaded at the start of the task.
1088
+ - "none": Do not load any checkpoint
1089
+ - "fresh": Loads the lastest checkpoint created within the running Task.
1090
+ This mode helps loading checkpoints across various retry attempts of the same task.
1091
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
1092
+ created within the task will be loaded when the task is retries execution on failure.
1093
+
1094
+ temp_dir_root : str, default: None
1095
+ The root directory under which `current.checkpoint.directory` will be created.
1096
+
1097
+
1098
+
1138
1099
  """
1139
1100
  ...
1140
1101
 
1141
1102
  @typing.overload
1142
- 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]]]:
1103
+ 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]]]:
1143
1104
  """
1144
- Specifies that the step will success under all circumstances.
1105
+ Specifies the resources needed when executing this step.
1145
1106
 
1146
- The decorator will create an optional artifact, specified by `var`, which
1147
- contains the exception raised. You can use it to detect the presence
1148
- of errors, indicating that all happy-path artifacts produced by the step
1149
- are missing.
1107
+ Use `@resources` to specify the resource requirements
1108
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1109
+
1110
+ You can choose the compute layer on the command line by executing e.g.
1111
+ ```
1112
+ python myflow.py run --with batch
1113
+ ```
1114
+ or
1115
+ ```
1116
+ python myflow.py run --with kubernetes
1117
+ ```
1118
+ which executes the flow on the desired system using the
1119
+ requirements specified in `@resources`.
1150
1120
 
1151
1121
  Parameters
1152
1122
  ----------
1153
- var : str, optional, default None
1154
- Name of the artifact in which to store the caught exception.
1155
- If not specified, the exception is not stored.
1156
- print_exception : bool, default True
1157
- Determines whether or not the exception is printed to
1158
- stdout when caught.
1123
+ cpu : int, default 1
1124
+ Number of CPUs required for this step.
1125
+ gpu : int, default 0
1126
+ Number of GPUs required for this step.
1127
+ disk : int, optional, default None
1128
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1129
+ memory : int, default 4096
1130
+ Memory size (in MB) required for this step.
1131
+ shared_memory : int, optional, default None
1132
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1133
+ This parameter maps to the `--shm-size` option in Docker.
1159
1134
  """
1160
1135
  ...
1161
1136
 
1162
1137
  @typing.overload
1163
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1138
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1164
1139
  ...
1165
1140
 
1166
1141
  @typing.overload
1167
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1142
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1168
1143
  ...
1169
1144
 
1170
- 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):
1145
+ 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):
1171
1146
  """
1172
- Specifies that the step will success under all circumstances.
1147
+ Specifies the resources needed when executing this step.
1173
1148
 
1174
- The decorator will create an optional artifact, specified by `var`, which
1175
- contains the exception raised. You can use it to detect the presence
1176
- of errors, indicating that all happy-path artifacts produced by the step
1177
- are missing.
1149
+ Use `@resources` to specify the resource requirements
1150
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1151
+
1152
+ You can choose the compute layer on the command line by executing e.g.
1153
+ ```
1154
+ python myflow.py run --with batch
1155
+ ```
1156
+ or
1157
+ ```
1158
+ python myflow.py run --with kubernetes
1159
+ ```
1160
+ which executes the flow on the desired system using the
1161
+ requirements specified in `@resources`.
1178
1162
 
1179
1163
  Parameters
1180
1164
  ----------
1181
- var : str, optional, default None
1182
- Name of the artifact in which to store the caught exception.
1183
- If not specified, the exception is not stored.
1184
- print_exception : bool, default True
1185
- Determines whether or not the exception is printed to
1186
- stdout when caught.
1165
+ cpu : int, default 1
1166
+ Number of CPUs required for this step.
1167
+ gpu : int, default 0
1168
+ Number of GPUs required for this step.
1169
+ disk : int, optional, default None
1170
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1171
+ memory : int, default 4096
1172
+ Memory size (in MB) required for this step.
1173
+ shared_memory : int, optional, default None
1174
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1175
+ This parameter maps to the `--shm-size` option in Docker.
1176
+ """
1177
+ ...
1178
+
1179
+ def huggingface_hub(*, temp_dir_root: 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]]]:
1180
+ """
1181
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
1182
+
1183
+ Parameters
1184
+ ----------
1185
+ temp_dir_root : str, optional
1186
+ The root directory that will hold the temporary directory where objects will be downloaded.
1187
+
1188
+
1187
1189
  """
1188
1190
  ...
1189
1191
 
1190
1192
  @typing.overload
1191
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1193
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1192
1194
  """
1193
- Decorator prototype for all step decorators. This function gets specialized
1194
- and imported for all decorators types by _import_plugin_decorators().
1195
+ Internal decorator to support Fast bakery
1195
1196
  """
1196
1197
  ...
1197
1198
 
1198
1199
  @typing.overload
1199
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1200
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1200
1201
  ...
1201
1202
 
1202
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1203
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1203
1204
  """
1204
- Decorator prototype for all step decorators. This function gets specialized
1205
- and imported for all decorators types by _import_plugin_decorators().
1205
+ Internal decorator to support Fast bakery
1206
1206
  """
1207
1207
  ...
1208
1208
 
1209
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1209
+ @typing.overload
1210
+ 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]]:
1210
1211
  """
1211
- Specifies what flows belong to the same project.
1212
+ Specifies the flow(s) that this flow depends on.
1212
1213
 
1213
- A project-specific namespace is created for all flows that
1214
- use the same `@project(name)`.
1214
+ ```
1215
+ @trigger_on_finish(flow='FooFlow')
1216
+ ```
1217
+ or
1218
+ ```
1219
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1220
+ ```
1221
+ This decorator respects the @project decorator and triggers the flow
1222
+ when upstream runs within the same namespace complete successfully
1223
+
1224
+ Additionally, you can specify project aware upstream flow dependencies
1225
+ by specifying the fully qualified project_flow_name.
1226
+ ```
1227
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1228
+ ```
1229
+ or
1230
+ ```
1231
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1232
+ ```
1233
+
1234
+ You can also specify just the project or project branch (other values will be
1235
+ inferred from the current project or project branch):
1236
+ ```
1237
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1238
+ ```
1239
+
1240
+ Note that `branch` is typically one of:
1241
+ - `prod`
1242
+ - `user.bob`
1243
+ - `test.my_experiment`
1244
+ - `prod.staging`
1215
1245
 
1216
1246
  Parameters
1217
1247
  ----------
1218
- name : str
1219
- Project name. Make sure that the name is unique amongst all
1220
- projects that use the same production scheduler. The name may
1221
- contain only lowercase alphanumeric characters and underscores.
1248
+ flow : Union[str, Dict[str, str]], optional, default None
1249
+ Upstream flow dependency for this flow.
1250
+ flows : List[Union[str, Dict[str, str]]], default []
1251
+ Upstream flow dependencies for this flow.
1252
+ options : Dict[str, Any], default {}
1253
+ Backend-specific configuration for tuning eventing behavior.
1222
1254
 
1223
1255
 
1224
1256
  """
1225
1257
  ...
1226
1258
 
1227
- 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]]:
1259
+ @typing.overload
1260
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1261
+ ...
1262
+
1263
+ 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] = {}):
1228
1264
  """
1229
- 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.
1230
- 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.
1265
+ Specifies the flow(s) that this flow depends on.
1266
+
1267
+ ```
1268
+ @trigger_on_finish(flow='FooFlow')
1269
+ ```
1270
+ or
1271
+ ```
1272
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1273
+ ```
1274
+ This decorator respects the @project decorator and triggers the flow
1275
+ when upstream runs within the same namespace complete successfully
1276
+
1277
+ Additionally, you can specify project aware upstream flow dependencies
1278
+ by specifying the fully qualified project_flow_name.
1279
+ ```
1280
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1281
+ ```
1282
+ or
1283
+ ```
1284
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1285
+ ```
1286
+
1287
+ You can also specify just the project or project branch (other values will be
1288
+ inferred from the current project or project branch):
1289
+ ```
1290
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1291
+ ```
1292
+
1293
+ Note that `branch` is typically one of:
1294
+ - `prod`
1295
+ - `user.bob`
1296
+ - `test.my_experiment`
1297
+ - `prod.staging`
1298
+
1299
+ Parameters
1300
+ ----------
1301
+ flow : Union[str, Dict[str, str]], optional, default None
1302
+ Upstream flow dependency for this flow.
1303
+ flows : List[Union[str, Dict[str, str]]], default []
1304
+ Upstream flow dependencies for this flow.
1305
+ options : Dict[str, Any], default {}
1306
+ Backend-specific configuration for tuning eventing behavior.
1307
+
1308
+
1309
+ """
1310
+ ...
1311
+
1312
+ 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]]:
1313
+ """
1314
+ 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)
1315
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1316
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1317
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1318
+ starts only after all sensors finish.
1231
1319
 
1232
1320
  Parameters
1233
1321
  ----------
@@ -1248,106 +1336,72 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1248
1336
  Name of the sensor on Airflow
1249
1337
  description : str
1250
1338
  Description of sensor in the Airflow UI
1251
- external_dag_id : str
1252
- The dag_id that contains the task you want to wait for.
1253
- external_task_ids : List[str]
1254
- The list of task_ids that you want to wait for.
1255
- If None (default value) the sensor waits for the DAG. (Default: None)
1256
- allowed_states : List[str]
1257
- Iterable of allowed states, (Default: ['success'])
1258
- failed_states : List[str]
1259
- Iterable of failed or dis-allowed states. (Default: None)
1260
- execution_delta : datetime.timedelta
1261
- time difference with the previous execution to look at,
1262
- the default is the same logical date as the current task or DAG. (Default: None)
1263
- check_existence: bool
1264
- Set to True to check if the external task exists or check if
1265
- the DAG to wait for exists. (Default: True)
1339
+ bucket_key : Union[str, List[str]]
1340
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1341
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1342
+ bucket_name : str
1343
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1344
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1345
+ wildcard_match : bool
1346
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1347
+ aws_conn_id : str
1348
+ a reference to the s3 connection on Airflow. (Default: None)
1349
+ verify : bool
1350
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1266
1351
  """
1267
1352
  ...
1268
1353
 
1269
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1354
+ @typing.overload
1355
+ 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]]:
1270
1356
  """
1271
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1272
-
1273
- User code call
1274
- -----------
1275
- @nim(
1276
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1277
- backend='managed'
1278
- )
1279
-
1280
- Valid backend options
1281
- ---------------------
1282
- - 'managed': Outerbounds selects a compute provider based on the model.
1283
- - 🚧 'dataplane': Run in your account.
1284
-
1285
- Valid model options
1286
- ----------------
1287
- - 'meta/llama3-8b-instruct': 8B parameter model
1288
- - 'meta/llama3-70b-instruct': 70B parameter model
1289
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1357
+ Specifies the times when the flow should be run when running on a
1358
+ production scheduler.
1290
1359
 
1291
1360
  Parameters
1292
1361
  ----------
1293
- models: list[NIM]
1294
- List of NIM containers running models in sidecars.
1295
- backend: str
1296
- Compute provider to run the NIM container.
1362
+ hourly : bool, default False
1363
+ Run the workflow hourly.
1364
+ daily : bool, default True
1365
+ Run the workflow daily.
1366
+ weekly : bool, default False
1367
+ Run the workflow weekly.
1368
+ cron : str, optional, default None
1369
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1370
+ specified by this expression.
1371
+ timezone : str, optional, default None
1372
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1373
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1297
1374
  """
1298
1375
  ...
1299
1376
 
1300
1377
  @typing.overload
1301
- def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1378
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1379
+ ...
1380
+
1381
+ 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):
1302
1382
  """
1303
- Specifies the event(s) that this flow depends on.
1304
-
1305
- ```
1306
- @trigger(event='foo')
1307
- ```
1308
- or
1309
- ```
1310
- @trigger(events=['foo', 'bar'])
1311
- ```
1312
-
1313
- Additionally, you can specify the parameter mappings
1314
- to map event payload to Metaflow parameters for the flow.
1315
- ```
1316
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1317
- ```
1318
- or
1319
- ```
1320
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1321
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1322
- ```
1323
-
1324
- 'parameters' can also be a list of strings and tuples like so:
1325
- ```
1326
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1327
- ```
1328
- This is equivalent to:
1329
- ```
1330
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1331
- ```
1383
+ Specifies the times when the flow should be run when running on a
1384
+ production scheduler.
1332
1385
 
1333
1386
  Parameters
1334
1387
  ----------
1335
- event : Union[str, Dict[str, Any]], optional, default None
1336
- Event dependency for this flow.
1337
- events : List[Union[str, Dict[str, Any]]], default []
1338
- Events dependency for this flow.
1339
- options : Dict[str, Any], default {}
1340
- Backend-specific configuration for tuning eventing behavior.
1341
-
1342
-
1388
+ hourly : bool, default False
1389
+ Run the workflow hourly.
1390
+ daily : bool, default True
1391
+ Run the workflow daily.
1392
+ weekly : bool, default False
1393
+ Run the workflow weekly.
1394
+ cron : str, optional, default None
1395
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1396
+ specified by this expression.
1397
+ timezone : str, optional, default None
1398
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1399
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1343
1400
  """
1344
1401
  ...
1345
1402
 
1346
1403
  @typing.overload
1347
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1348
- ...
1349
-
1350
- def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1404
+ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1351
1405
  """
1352
1406
  Specifies the event(s) that this flow depends on.
1353
1407
 
@@ -1381,60 +1435,10 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1381
1435
 
1382
1436
  Parameters
1383
1437
  ----------
1384
- event : Union[str, Dict[str, Any]], optional, default None
1385
- Event dependency for this flow.
1386
- events : List[Union[str, Dict[str, Any]]], default []
1387
- Events dependency for this flow.
1388
- options : Dict[str, Any], default {}
1389
- Backend-specific configuration for tuning eventing behavior.
1390
-
1391
-
1392
- """
1393
- ...
1394
-
1395
- @typing.overload
1396
- 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]]:
1397
- """
1398
- Specifies the flow(s) that this flow depends on.
1399
-
1400
- ```
1401
- @trigger_on_finish(flow='FooFlow')
1402
- ```
1403
- or
1404
- ```
1405
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1406
- ```
1407
- This decorator respects the @project decorator and triggers the flow
1408
- when upstream runs within the same namespace complete successfully
1409
-
1410
- Additionally, you can specify project aware upstream flow dependencies
1411
- by specifying the fully qualified project_flow_name.
1412
- ```
1413
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1414
- ```
1415
- or
1416
- ```
1417
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1418
- ```
1419
-
1420
- You can also specify just the project or project branch (other values will be
1421
- inferred from the current project or project branch):
1422
- ```
1423
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1424
- ```
1425
-
1426
- Note that `branch` is typically one of:
1427
- - `prod`
1428
- - `user.bob`
1429
- - `test.my_experiment`
1430
- - `prod.staging`
1431
-
1432
- Parameters
1433
- ----------
1434
- flow : Union[str, Dict[str, str]], optional, default None
1435
- Upstream flow dependency for this flow.
1436
- flows : List[Union[str, Dict[str, str]]], default []
1437
- Upstream flow dependencies for this flow.
1438
+ event : Union[str, Dict[str, Any]], optional, default None
1439
+ Event dependency for this flow.
1440
+ events : List[Union[str, Dict[str, Any]]], default []
1441
+ Events dependency for this flow.
1438
1442
  options : Dict[str, Any], default {}
1439
1443
  Backend-specific configuration for tuning eventing behavior.
1440
1444
 
@@ -1443,51 +1447,47 @@ def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] =
1443
1447
  ...
1444
1448
 
1445
1449
  @typing.overload
1446
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1450
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1447
1451
  ...
1448
1452
 
1449
- 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] = {}):
1453
+ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1450
1454
  """
1451
- Specifies the flow(s) that this flow depends on.
1455
+ Specifies the event(s) that this flow depends on.
1452
1456
 
1453
1457
  ```
1454
- @trigger_on_finish(flow='FooFlow')
1458
+ @trigger(event='foo')
1455
1459
  ```
1456
1460
  or
1457
1461
  ```
1458
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1462
+ @trigger(events=['foo', 'bar'])
1459
1463
  ```
1460
- This decorator respects the @project decorator and triggers the flow
1461
- when upstream runs within the same namespace complete successfully
1462
1464
 
1463
- Additionally, you can specify project aware upstream flow dependencies
1464
- by specifying the fully qualified project_flow_name.
1465
+ Additionally, you can specify the parameter mappings
1466
+ to map event payload to Metaflow parameters for the flow.
1465
1467
  ```
1466
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1468
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1467
1469
  ```
1468
1470
  or
1469
1471
  ```
1470
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1472
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1473
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1471
1474
  ```
1472
1475
 
1473
- You can also specify just the project or project branch (other values will be
1474
- inferred from the current project or project branch):
1476
+ 'parameters' can also be a list of strings and tuples like so:
1475
1477
  ```
1476
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1478
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1479
+ ```
1480
+ This is equivalent to:
1481
+ ```
1482
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1477
1483
  ```
1478
-
1479
- Note that `branch` is typically one of:
1480
- - `prod`
1481
- - `user.bob`
1482
- - `test.my_experiment`
1483
- - `prod.staging`
1484
1484
 
1485
1485
  Parameters
1486
1486
  ----------
1487
- flow : Union[str, Dict[str, str]], optional, default None
1488
- Upstream flow dependency for this flow.
1489
- flows : List[Union[str, Dict[str, str]]], default []
1490
- Upstream flow dependencies for this flow.
1487
+ event : Union[str, Dict[str, Any]], optional, default None
1488
+ Event dependency for this flow.
1489
+ events : List[Union[str, Dict[str, Any]]], default []
1490
+ Events dependency for this flow.
1491
1491
  options : Dict[str, Any], default {}
1492
1492
  Backend-specific configuration for tuning eventing behavior.
1493
1493
 
@@ -1495,52 +1495,34 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1495
1495
  """
1496
1496
  ...
1497
1497
 
1498
- @typing.overload
1499
- 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]]:
1498
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1500
1499
  """
1501
- Specifies the Conda environment for all steps of the flow.
1500
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1502
1501
 
1503
- Use `@conda_base` to set common libraries required by all
1504
- steps and use `@conda` to specify step-specific additions.
1502
+ User code call
1503
+ -----------
1504
+ @nim(
1505
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1506
+ backend='managed'
1507
+ )
1505
1508
 
1506
- Parameters
1507
- ----------
1508
- packages : Dict[str, str], default {}
1509
- Packages to use for this flow. The key is the name of the package
1510
- and the value is the version to use.
1511
- libraries : Dict[str, str], default {}
1512
- Supported for backward compatibility. When used with packages, packages will take precedence.
1513
- python : str, optional, default None
1514
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1515
- that the version used will correspond to the version of the Python interpreter used to start the run.
1516
- disabled : bool, default False
1517
- If set to True, disables Conda.
1518
- """
1519
- ...
1520
-
1521
- @typing.overload
1522
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1523
- ...
1524
-
1525
- 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):
1526
- """
1527
- Specifies the Conda environment for all steps of the flow.
1509
+ Valid backend options
1510
+ ---------------------
1511
+ - 'managed': Outerbounds selects a compute provider based on the model.
1512
+ - 🚧 'dataplane': Run in your account.
1528
1513
 
1529
- Use `@conda_base` to set common libraries required by all
1530
- steps and use `@conda` to specify step-specific additions.
1514
+ Valid model options
1515
+ ----------------
1516
+ - 'meta/llama3-8b-instruct': 8B parameter model
1517
+ - 'meta/llama3-70b-instruct': 70B parameter model
1518
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1531
1519
 
1532
1520
  Parameters
1533
1521
  ----------
1534
- packages : Dict[str, str], default {}
1535
- Packages to use for this flow. The key is the name of the package
1536
- and the value is the version to use.
1537
- libraries : Dict[str, str], default {}
1538
- Supported for backward compatibility. When used with packages, packages will take precedence.
1539
- python : str, optional, default None
1540
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1541
- that the version used will correspond to the version of the Python interpreter used to start the run.
1542
- disabled : bool, default False
1543
- If set to True, disables Conda.
1522
+ models: list[NIM]
1523
+ List of NIM containers running models in sidecars.
1524
+ backend: str
1525
+ Compute provider to run the NIM container.
1544
1526
  """
1545
1527
  ...
1546
1528
 
@@ -1583,94 +1565,112 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
1583
1565
  """
1584
1566
  ...
1585
1567
 
1568
+ 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]]:
1569
+ """
1570
+ 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.
1571
+ 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.
1572
+
1573
+ Parameters
1574
+ ----------
1575
+ timeout : int
1576
+ Time, in seconds before the task times out and fails. (Default: 3600)
1577
+ poke_interval : int
1578
+ Time in seconds that the job should wait in between each try. (Default: 60)
1579
+ mode : str
1580
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1581
+ exponential_backoff : bool
1582
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1583
+ pool : str
1584
+ the slot pool this task should run in,
1585
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1586
+ soft_fail : bool
1587
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1588
+ name : str
1589
+ Name of the sensor on Airflow
1590
+ description : str
1591
+ Description of sensor in the Airflow UI
1592
+ external_dag_id : str
1593
+ The dag_id that contains the task you want to wait for.
1594
+ external_task_ids : List[str]
1595
+ The list of task_ids that you want to wait for.
1596
+ If None (default value) the sensor waits for the DAG. (Default: None)
1597
+ allowed_states : List[str]
1598
+ Iterable of allowed states, (Default: ['success'])
1599
+ failed_states : List[str]
1600
+ Iterable of failed or dis-allowed states. (Default: None)
1601
+ execution_delta : datetime.timedelta
1602
+ time difference with the previous execution to look at,
1603
+ the default is the same logical date as the current task or DAG. (Default: None)
1604
+ check_existence: bool
1605
+ Set to True to check if the external task exists or check if
1606
+ the DAG to wait for exists. (Default: True)
1607
+ """
1608
+ ...
1609
+
1586
1610
  @typing.overload
1587
- 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]]:
1611
+ 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]]:
1588
1612
  """
1589
- Specifies the times when the flow should be run when running on a
1590
- production scheduler.
1613
+ Specifies the Conda environment for all steps of the flow.
1614
+
1615
+ Use `@conda_base` to set common libraries required by all
1616
+ steps and use `@conda` to specify step-specific additions.
1591
1617
 
1592
1618
  Parameters
1593
1619
  ----------
1594
- hourly : bool, default False
1595
- Run the workflow hourly.
1596
- daily : bool, default True
1597
- Run the workflow daily.
1598
- weekly : bool, default False
1599
- Run the workflow weekly.
1600
- cron : str, optional, default None
1601
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1602
- specified by this expression.
1603
- timezone : str, optional, default None
1604
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1605
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1620
+ packages : Dict[str, str], default {}
1621
+ Packages to use for this flow. The key is the name of the package
1622
+ and the value is the version to use.
1623
+ libraries : Dict[str, str], default {}
1624
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1625
+ python : str, optional, default None
1626
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1627
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1628
+ disabled : bool, default False
1629
+ If set to True, disables Conda.
1606
1630
  """
1607
1631
  ...
1608
1632
 
1609
1633
  @typing.overload
1610
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1634
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1611
1635
  ...
1612
1636
 
1613
- 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):
1637
+ 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):
1614
1638
  """
1615
- Specifies the times when the flow should be run when running on a
1616
- production scheduler.
1639
+ Specifies the Conda environment for all steps of the flow.
1640
+
1641
+ Use `@conda_base` to set common libraries required by all
1642
+ steps and use `@conda` to specify step-specific additions.
1617
1643
 
1618
1644
  Parameters
1619
1645
  ----------
1620
- hourly : bool, default False
1621
- Run the workflow hourly.
1622
- daily : bool, default True
1623
- Run the workflow daily.
1624
- weekly : bool, default False
1625
- Run the workflow weekly.
1626
- cron : str, optional, default None
1627
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1628
- specified by this expression.
1629
- timezone : str, optional, default None
1630
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1631
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1646
+ packages : Dict[str, str], default {}
1647
+ Packages to use for this flow. The key is the name of the package
1648
+ and the value is the version to use.
1649
+ libraries : Dict[str, str], default {}
1650
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1651
+ python : str, optional, default None
1652
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1653
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1654
+ disabled : bool, default False
1655
+ If set to True, disables Conda.
1632
1656
  """
1633
1657
  ...
1634
1658
 
1635
- 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]]:
1659
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1636
1660
  """
1637
- 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)
1638
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1639
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1640
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1641
- starts only after all sensors finish.
1661
+ Specifies what flows belong to the same project.
1662
+
1663
+ A project-specific namespace is created for all flows that
1664
+ use the same `@project(name)`.
1642
1665
 
1643
1666
  Parameters
1644
1667
  ----------
1645
- timeout : int
1646
- Time, in seconds before the task times out and fails. (Default: 3600)
1647
- poke_interval : int
1648
- Time in seconds that the job should wait in between each try. (Default: 60)
1649
- mode : str
1650
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1651
- exponential_backoff : bool
1652
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1653
- pool : str
1654
- the slot pool this task should run in,
1655
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1656
- soft_fail : bool
1657
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1658
1668
  name : str
1659
- Name of the sensor on Airflow
1660
- description : str
1661
- Description of sensor in the Airflow UI
1662
- bucket_key : Union[str, List[str]]
1663
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1664
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1665
- bucket_name : str
1666
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1667
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1668
- wildcard_match : bool
1669
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1670
- aws_conn_id : str
1671
- a reference to the s3 connection on Airflow. (Default: None)
1672
- verify : bool
1673
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1669
+ Project name. Make sure that the name is unique amongst all
1670
+ projects that use the same production scheduler. The name may
1671
+ contain only lowercase alphanumeric characters and underscores.
1672
+
1673
+
1674
1674
  """
1675
1675
  ...
1676
1676