ob-metaflow-stubs 6.0.3.102rc0__py2.py3-none-any.whl → 6.0.3.102rc2__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. metaflow-stubs/__init__.pyi +452 -452
  2. metaflow-stubs/cards.pyi +4 -4
  3. metaflow-stubs/cli.pyi +1 -1
  4. metaflow-stubs/client/__init__.pyi +2 -2
  5. metaflow-stubs/client/core.pyi +4 -4
  6. metaflow-stubs/client/filecache.pyi +1 -1
  7. metaflow-stubs/clone_util.pyi +1 -1
  8. metaflow-stubs/events.pyi +1 -1
  9. metaflow-stubs/exception.pyi +1 -1
  10. metaflow-stubs/flowspec.pyi +4 -4
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +3 -3
  13. metaflow-stubs/info_file.pyi +1 -1
  14. metaflow-stubs/metadata/metadata.pyi +1 -1
  15. metaflow-stubs/metadata/util.pyi +1 -1
  16. metaflow-stubs/metaflow_config.pyi +1 -1
  17. metaflow-stubs/metaflow_current.pyi +55 -55
  18. metaflow-stubs/mflog/mflog.pyi +1 -1
  19. metaflow-stubs/multicore_utils.pyi +1 -1
  20. metaflow-stubs/parameters.pyi +3 -3
  21. metaflow-stubs/plugins/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  23. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  24. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  25. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  26. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
  27. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  29. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  30. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  31. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  32. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  33. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +6 -6
  34. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
  35. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
  36. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  37. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  38. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  39. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  40. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  41. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  42. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  43. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  44. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
  45. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  46. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  47. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +1 -1
  48. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  49. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  50. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  51. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  52. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  53. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  54. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  55. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +2 -2
  56. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  57. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  58. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  59. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  60. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  61. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  62. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  63. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  64. metaflow-stubs/plugins/cards/card_decorator.pyi +1 -1
  65. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  66. metaflow-stubs/plugins/cards/card_modules/basic.pyi +1 -1
  67. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  68. metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  70. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  71. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
  72. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  73. metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
  74. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  75. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  76. metaflow-stubs/plugins/datatools/__init__.pyi +1 -1
  77. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  78. metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
  79. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  80. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  81. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  82. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  83. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  84. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  85. metaflow-stubs/plugins/events_decorator.pyi +1 -1
  86. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  87. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  88. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  89. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
  90. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  91. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  92. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  93. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  94. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  95. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +1 -1
  96. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +1 -1
  97. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +2 -2
  98. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  99. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  100. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
  101. metaflow-stubs/plugins/logs_cli.pyi +2 -2
  102. metaflow-stubs/plugins/package_cli.pyi +1 -1
  103. metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
  104. metaflow-stubs/plugins/perimeters.pyi +1 -1
  105. metaflow-stubs/plugins/project_decorator.pyi +1 -1
  106. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  107. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  108. metaflow-stubs/plugins/pypi/conda_environment.pyi +1 -1
  109. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  110. metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
  111. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  112. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  113. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  114. metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
  115. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +1 -1
  116. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  117. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  118. metaflow-stubs/plugins/tag_cli.pyi +3 -3
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/timeout_decorator.pyi +1 -1
  121. metaflow-stubs/procpoll.pyi +1 -1
  122. metaflow-stubs/profilers/__init__.pyi +1 -1
  123. metaflow-stubs/pylint_wrapper.pyi +1 -1
  124. metaflow-stubs/runner/__init__.pyi +1 -1
  125. metaflow-stubs/runner/deployer.pyi +3 -3
  126. metaflow-stubs/runner/metaflow_runner.pyi +2 -2
  127. metaflow-stubs/runner/nbdeploy.pyi +1 -1
  128. metaflow-stubs/runner/nbrun.pyi +1 -1
  129. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  130. metaflow-stubs/runner/utils.pyi +1 -1
  131. metaflow-stubs/system/__init__.pyi +2 -2
  132. metaflow-stubs/system/system_logger.pyi +1 -1
  133. metaflow-stubs/system/system_monitor.pyi +1 -1
  134. metaflow-stubs/tagging_util.pyi +1 -1
  135. metaflow-stubs/tuple_util.pyi +1 -1
  136. {ob_metaflow_stubs-6.0.3.102rc0.dist-info → ob_metaflow_stubs-6.0.3.102rc2.dist-info}/METADATA +1 -1
  137. ob_metaflow_stubs-6.0.3.102rc2.dist-info/RECORD +140 -0
  138. ob_metaflow_stubs-6.0.3.102rc0.dist-info/RECORD +0 -140
  139. {ob_metaflow_stubs-6.0.3.102rc0.dist-info → ob_metaflow_stubs-6.0.3.102rc2.dist-info}/WHEEL +0 -0
  140. {ob_metaflow_stubs-6.0.3.102rc0.dist-info → ob_metaflow_stubs-6.0.3.102rc2.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,24 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.22.1+obcheckpoint(0.0.10);ob(v1) #
4
- # Generated on 2024-09-20T18:35:21.800373 #
4
+ # Generated on 2024-09-20T18:57:11.211223 #
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.events
12
- import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
13
- import metaflow.datastore.inputs
14
11
  import metaflow.metaflow_current
15
- import metaflow._vendor.click.types
12
+ import metaflow.datastore.inputs
13
+ import metaflow.events
16
14
  import metaflow.runner.metaflow_runner
17
- import typing
18
- import metaflow.flowspec
19
15
  import metaflow.client.core
20
- import metaflow.parameters
21
16
  import datetime
17
+ import metaflow._vendor.click.types
18
+ import metaflow.parameters
19
+ import metaflow.flowspec
20
+ import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
21
+ import typing
22
22
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
23
23
  StepFlag = typing.NewType("StepFlag", bool)
24
24
 
@@ -435,51 +435,51 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
435
435
  ...
436
436
 
437
437
  @typing.overload
438
- 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]]]:
438
+ 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]]]:
439
439
  """
440
- Specifies that the step will success under all circumstances.
440
+ Specifies the PyPI packages for the step.
441
441
 
442
- The decorator will create an optional artifact, specified by `var`, which
443
- contains the exception raised. You can use it to detect the presence
444
- of errors, indicating that all happy-path artifacts produced by the step
445
- are missing.
442
+ Information in this decorator will augment any
443
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
444
+ you can use `@pypi_base` to set packages required by all
445
+ steps and use `@pypi` to specify step-specific overrides.
446
446
 
447
447
  Parameters
448
448
  ----------
449
- var : str, optional, default None
450
- Name of the artifact in which to store the caught exception.
451
- If not specified, the exception is not stored.
452
- print_exception : bool, default True
453
- Determines whether or not the exception is printed to
454
- stdout when caught.
449
+ packages : Dict[str, str], default: {}
450
+ Packages to use for this step. The key is the name of the package
451
+ and the value is the version to use.
452
+ python : str, optional, default: None
453
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
454
+ that the version used will correspond to the version of the Python interpreter used to start the run.
455
455
  """
456
456
  ...
457
457
 
458
458
  @typing.overload
459
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
459
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
460
460
  ...
461
461
 
462
462
  @typing.overload
463
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
463
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
464
464
  ...
465
465
 
466
- def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
466
+ 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):
467
467
  """
468
- Specifies that the step will success under all circumstances.
468
+ Specifies the PyPI packages for the step.
469
469
 
470
- The decorator will create an optional artifact, specified by `var`, which
471
- contains the exception raised. You can use it to detect the presence
472
- of errors, indicating that all happy-path artifacts produced by the step
473
- are missing.
470
+ Information in this decorator will augment any
471
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
472
+ you can use `@pypi_base` to set packages required by all
473
+ steps and use `@pypi` to specify step-specific overrides.
474
474
 
475
475
  Parameters
476
476
  ----------
477
- var : str, optional, default None
478
- Name of the artifact in which to store the caught exception.
479
- If not specified, the exception is not stored.
480
- print_exception : bool, default True
481
- Determines whether or not the exception is printed to
482
- stdout when caught.
477
+ packages : Dict[str, str], default: {}
478
+ Packages to use for this step. The key is the name of the package
479
+ and the value is the version to use.
480
+ python : str, optional, default: None
481
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
482
+ that the version used will correspond to the version of the Python interpreter used to start the run.
483
483
  """
484
484
  ...
485
485
 
@@ -684,129 +684,63 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
684
684
  ...
685
685
 
686
686
  @typing.overload
687
- 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]]]:
687
+ 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]]]:
688
688
  """
689
- Specifies environment variables to be set prior to the execution of a step.
689
+ Enables checkpointing for a step.
690
690
 
691
- Parameters
692
- ----------
693
- vars : Dict[str, str], default {}
694
- Dictionary of environment variables to set.
695
- """
696
- ...
697
-
698
- @typing.overload
699
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
700
- ...
701
-
702
- @typing.overload
703
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
704
- ...
705
-
706
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
707
- """
708
- Specifies environment variables to be set prior to the execution of a step.
709
691
 
710
692
  Parameters
711
693
  ----------
712
- vars : Dict[str, str], default {}
713
- Dictionary of environment variables to set.
714
- """
715
- ...
716
-
717
- @typing.overload
718
- 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]]]:
719
- """
720
- Specifies the resources needed when executing this step.
694
+ load_policy : str, default: "fresh"
695
+ The policy for loading the checkpoint. The following policies are supported:
696
+ - "eager": Loads the the latest available checkpoint within the namespace.
697
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
698
+ will be loaded at the start of the task.
699
+ - "none": Do not load any checkpoint
700
+ - "fresh": Loads the lastest checkpoint created within the running Task.
701
+ This mode helps loading checkpoints across various retry attempts of the same task.
702
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
703
+ created within the task will be loaded when the task is retries execution on failure.
704
+
705
+ temp_dir_root : str, default: None
706
+ The root directory under which `current.checkpoint.directory` will be created.
721
707
 
722
- Use `@resources` to specify the resource requirements
723
- independently of the specific compute layer (`@batch`, `@kubernetes`).
724
708
 
725
- You can choose the compute layer on the command line by executing e.g.
726
- ```
727
- python myflow.py run --with batch
728
- ```
729
- or
730
- ```
731
- python myflow.py run --with kubernetes
732
- ```
733
- which executes the flow on the desired system using the
734
- requirements specified in `@resources`.
735
709
 
736
- Parameters
737
- ----------
738
- cpu : int, default 1
739
- Number of CPUs required for this step.
740
- gpu : int, default 0
741
- Number of GPUs required for this step.
742
- disk : int, optional, default None
743
- Disk size (in MB) required for this step. Only applies on Kubernetes.
744
- memory : int, default 4096
745
- Memory size (in MB) required for this step.
746
- shared_memory : int, optional, default None
747
- The value for the size (in MiB) of the /dev/shm volume for this step.
748
- This parameter maps to the `--shm-size` option in Docker.
749
710
  """
750
711
  ...
751
712
 
752
713
  @typing.overload
753
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
714
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
754
715
  ...
755
716
 
756
717
  @typing.overload
757
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
718
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
758
719
  ...
759
720
 
760
- 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):
721
+ 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):
761
722
  """
762
- Specifies the resources needed when executing this step.
763
-
764
- Use `@resources` to specify the resource requirements
765
- independently of the specific compute layer (`@batch`, `@kubernetes`).
723
+ Enables checkpointing for a step.
766
724
 
767
- You can choose the compute layer on the command line by executing e.g.
768
- ```
769
- python myflow.py run --with batch
770
- ```
771
- or
772
- ```
773
- python myflow.py run --with kubernetes
774
- ```
775
- which executes the flow on the desired system using the
776
- requirements specified in `@resources`.
777
725
 
778
726
  Parameters
779
727
  ----------
780
- cpu : int, default 1
781
- Number of CPUs required for this step.
782
- gpu : int, default 0
783
- Number of GPUs required for this step.
784
- disk : int, optional, default None
785
- Disk size (in MB) required for this step. Only applies on Kubernetes.
786
- memory : int, default 4096
787
- Memory size (in MB) required for this step.
788
- shared_memory : int, optional, default None
789
- The value for the size (in MiB) of the /dev/shm volume for this step.
790
- This parameter maps to the `--shm-size` option in Docker.
791
- """
792
- ...
793
-
794
- @typing.overload
795
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
796
- """
797
- Decorator prototype for all step decorators. This function gets specialized
798
- and imported for all decorators types by _import_plugin_decorators().
799
- """
800
- ...
801
-
802
- @typing.overload
803
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
804
- ...
805
-
806
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
807
- """
808
- Decorator prototype for all step decorators. This function gets specialized
809
- and imported for all decorators types by _import_plugin_decorators().
728
+ load_policy : str, default: "fresh"
729
+ The policy for loading the checkpoint. The following policies are supported:
730
+ - "eager": Loads the the latest available checkpoint within the namespace.
731
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
732
+ will be loaded at the start of the task.
733
+ - "none": Do not load any checkpoint
734
+ - "fresh": Loads the lastest checkpoint created within the running Task.
735
+ This mode helps loading checkpoints across various retry attempts of the same task.
736
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
737
+ created within the task will be loaded when the task is retries execution on failure.
738
+
739
+ temp_dir_root : str, default: None
740
+ The root directory under which `current.checkpoint.directory` will be created.
741
+
742
+
743
+
810
744
  """
811
745
  ...
812
746
 
@@ -877,244 +811,451 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
877
811
  ...
878
812
 
879
813
  @typing.overload
880
- 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]]]:
814
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
881
815
  """
882
- Specifies the PyPI packages for the step.
883
-
884
- Information in this decorator will augment any
885
- attributes set in the `@pyi_base` flow-level decorator. Hence,
886
- you can use `@pypi_base` to set packages required by all
887
- steps and use `@pypi` to specify step-specific overrides.
888
-
889
- Parameters
890
- ----------
891
- packages : Dict[str, str], default: {}
892
- Packages to use for this step. The key is the name of the package
893
- and the value is the version to use.
894
- python : str, optional, default: None
895
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
896
- that the version used will correspond to the version of the Python interpreter used to start the run.
816
+ Decorator prototype for all step decorators. This function gets specialized
817
+ and imported for all decorators types by _import_plugin_decorators().
897
818
  """
898
819
  ...
899
820
 
900
821
  @typing.overload
901
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
902
- ...
903
-
904
- @typing.overload
905
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
822
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
906
823
  ...
907
824
 
908
- 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):
825
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
909
826
  """
910
- Specifies the PyPI packages for the step.
911
-
912
- Information in this decorator will augment any
913
- attributes set in the `@pyi_base` flow-level decorator. Hence,
914
- you can use `@pypi_base` to set packages required by all
915
- steps and use `@pypi` to specify step-specific overrides.
916
-
917
- Parameters
918
- ----------
919
- packages : Dict[str, str], default: {}
920
- Packages to use for this step. The key is the name of the package
921
- and the value is the version to use.
922
- python : str, optional, default: None
923
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
924
- that the version used will correspond to the version of the Python interpreter used to start the run.
827
+ Decorator prototype for all step decorators. This function gets specialized
828
+ and imported for all decorators types by _import_plugin_decorators().
925
829
  """
926
830
  ...
927
831
 
928
832
  @typing.overload
929
- 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]]]:
833
+ 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]]]:
930
834
  """
931
- Creates a human-readable report, a Metaflow Card, after this step completes.
835
+ Enables loading / saving of models within a step.
932
836
 
933
- Note that you may add multiple `@card` decorators in a step with different parameters.
934
837
 
935
838
  Parameters
936
839
  ----------
937
- type : str, default 'default'
938
- Card type.
939
- id : str, optional, default None
940
- If multiple cards are present, use this id to identify this card.
941
- options : Dict[str, Any], default {}
942
- Options passed to the card. The contents depend on the card type.
943
- timeout : int, default 45
944
- Interrupt reporting if it takes more than this many seconds.
840
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
841
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
842
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
843
+ - `current.checkpoint`
844
+ - `current.model`
845
+ - `current.huggingface_hub`
846
+
847
+ 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
848
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
849
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
850
+
851
+ temp_dir_root : str, default: None
852
+ The root directory under which `current.model.loaded` will store loaded models
853
+
945
854
 
946
855
 
947
856
  """
948
857
  ...
949
858
 
950
859
  @typing.overload
951
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
860
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
952
861
  ...
953
862
 
954
863
  @typing.overload
955
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
864
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
956
865
  ...
957
866
 
958
- 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):
867
+ 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):
959
868
  """
960
- Creates a human-readable report, a Metaflow Card, after this step completes.
869
+ Enables loading / saving of models within a step.
961
870
 
962
- Note that you may add multiple `@card` decorators in a step with different parameters.
963
871
 
964
872
  Parameters
965
873
  ----------
966
- type : str, default 'default'
967
- Card type.
968
- id : str, optional, default None
969
- If multiple cards are present, use this id to identify this card.
970
- options : Dict[str, Any], default {}
971
- Options passed to the card. The contents depend on the card type.
972
- timeout : int, default 45
973
- Interrupt reporting if it takes more than this many seconds.
874
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
875
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
876
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
877
+ - `current.checkpoint`
878
+ - `current.model`
879
+ - `current.huggingface_hub`
880
+
881
+ 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
882
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
883
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
884
+
885
+ temp_dir_root : str, default: None
886
+ The root directory under which `current.model.loaded` will store loaded models
887
+
974
888
 
975
889
 
976
890
  """
977
891
  ...
978
892
 
979
893
  @typing.overload
980
- 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]]]:
894
+ 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]]]:
981
895
  """
982
- Enables checkpointing for a step.
896
+ Specifies that the step will success under all circumstances.
983
897
 
898
+ The decorator will create an optional artifact, specified by `var`, which
899
+ contains the exception raised. You can use it to detect the presence
900
+ of errors, indicating that all happy-path artifacts produced by the step
901
+ are missing.
984
902
 
985
903
  Parameters
986
904
  ----------
987
- load_policy : str, default: "fresh"
988
- The policy for loading the checkpoint. The following policies are supported:
989
- - "eager": Loads the the latest available checkpoint within the namespace.
990
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
991
- will be loaded at the start of the task.
992
- - "none": Do not load any checkpoint
993
- - "fresh": Loads the lastest checkpoint created within the running Task.
994
- This mode helps loading checkpoints across various retry attempts of the same task.
995
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
996
- created within the task will be loaded when the task is retries execution on failure.
905
+ var : str, optional, default None
906
+ Name of the artifact in which to store the caught exception.
907
+ If not specified, the exception is not stored.
908
+ print_exception : bool, default True
909
+ Determines whether or not the exception is printed to
910
+ stdout when caught.
911
+ """
912
+ ...
913
+
914
+ @typing.overload
915
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
916
+ ...
917
+
918
+ @typing.overload
919
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
920
+ ...
921
+
922
+ 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):
923
+ """
924
+ Specifies that the step will success under all circumstances.
997
925
 
998
- temp_dir_root : str, default: None
999
- The root directory under which `current.checkpoint.directory` will be created.
926
+ The decorator will create an optional artifact, specified by `var`, which
927
+ contains the exception raised. You can use it to detect the presence
928
+ of errors, indicating that all happy-path artifacts produced by the step
929
+ are missing.
1000
930
 
931
+ Parameters
932
+ ----------
933
+ var : str, optional, default None
934
+ Name of the artifact in which to store the caught exception.
935
+ If not specified, the exception is not stored.
936
+ print_exception : bool, default True
937
+ Determines whether or not the exception is printed to
938
+ stdout when caught.
939
+ """
940
+ ...
941
+
942
+ @typing.overload
943
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
944
+ """
945
+ Internal decorator to support Fast bakery
946
+ """
947
+ ...
948
+
949
+ @typing.overload
950
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
951
+ ...
952
+
953
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
954
+ """
955
+ Internal decorator to support Fast bakery
956
+ """
957
+ ...
958
+
959
+ @typing.overload
960
+ 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]]]:
961
+ """
962
+ Specifies the resources needed when executing this step.
963
+
964
+ Use `@resources` to specify the resource requirements
965
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1001
966
 
967
+ You can choose the compute layer on the command line by executing e.g.
968
+ ```
969
+ python myflow.py run --with batch
970
+ ```
971
+ or
972
+ ```
973
+ python myflow.py run --with kubernetes
974
+ ```
975
+ which executes the flow on the desired system using the
976
+ requirements specified in `@resources`.
1002
977
 
978
+ Parameters
979
+ ----------
980
+ cpu : int, default 1
981
+ Number of CPUs required for this step.
982
+ gpu : int, default 0
983
+ Number of GPUs required for this step.
984
+ disk : int, optional, default None
985
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
986
+ memory : int, default 4096
987
+ Memory size (in MB) required for this step.
988
+ shared_memory : int, optional, default None
989
+ The value for the size (in MiB) of the /dev/shm volume for this step.
990
+ This parameter maps to the `--shm-size` option in Docker.
1003
991
  """
1004
992
  ...
1005
993
 
1006
994
  @typing.overload
1007
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
995
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1008
996
  ...
1009
997
 
1010
998
  @typing.overload
1011
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
999
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1012
1000
  ...
1013
1001
 
1014
- 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):
1002
+ 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):
1015
1003
  """
1016
- Enables checkpointing for a step.
1004
+ Specifies the resources needed when executing this step.
1005
+
1006
+ Use `@resources` to specify the resource requirements
1007
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1017
1008
 
1009
+ You can choose the compute layer on the command line by executing e.g.
1010
+ ```
1011
+ python myflow.py run --with batch
1012
+ ```
1013
+ or
1014
+ ```
1015
+ python myflow.py run --with kubernetes
1016
+ ```
1017
+ which executes the flow on the desired system using the
1018
+ requirements specified in `@resources`.
1018
1019
 
1019
1020
  Parameters
1020
1021
  ----------
1021
- load_policy : str, default: "fresh"
1022
- The policy for loading the checkpoint. The following policies are supported:
1023
- - "eager": Loads the the latest available checkpoint within the namespace.
1024
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
1025
- will be loaded at the start of the task.
1026
- - "none": Do not load any checkpoint
1027
- - "fresh": Loads the lastest checkpoint created within the running Task.
1028
- This mode helps loading checkpoints across various retry attempts of the same task.
1029
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
1030
- created within the task will be loaded when the task is retries execution on failure.
1022
+ cpu : int, default 1
1023
+ Number of CPUs required for this step.
1024
+ gpu : int, default 0
1025
+ Number of GPUs required for this step.
1026
+ disk : int, optional, default None
1027
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1028
+ memory : int, default 4096
1029
+ Memory size (in MB) required for this step.
1030
+ shared_memory : int, optional, default None
1031
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1032
+ This parameter maps to the `--shm-size` option in Docker.
1033
+ """
1034
+ ...
1035
+
1036
+ @typing.overload
1037
+ 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]]]:
1038
+ """
1039
+ Specifies environment variables to be set prior to the execution of a step.
1031
1040
 
1032
- temp_dir_root : str, default: None
1033
- The root directory under which `current.checkpoint.directory` will be created.
1041
+ Parameters
1042
+ ----------
1043
+ vars : Dict[str, str], default {}
1044
+ Dictionary of environment variables to set.
1045
+ """
1046
+ ...
1047
+
1048
+ @typing.overload
1049
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1050
+ ...
1051
+
1052
+ @typing.overload
1053
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1054
+ ...
1055
+
1056
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1057
+ """
1058
+ Specifies environment variables to be set prior to the execution of a step.
1034
1059
 
1060
+ Parameters
1061
+ ----------
1062
+ vars : Dict[str, str], default {}
1063
+ Dictionary of environment variables to set.
1064
+ """
1065
+ ...
1066
+
1067
+ @typing.overload
1068
+ def card(*, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1069
+ """
1070
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1071
+
1072
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1073
+
1074
+ Parameters
1075
+ ----------
1076
+ type : str, default 'default'
1077
+ Card type.
1078
+ id : str, optional, default None
1079
+ If multiple cards are present, use this id to identify this card.
1080
+ options : Dict[str, Any], default {}
1081
+ Options passed to the card. The contents depend on the card type.
1082
+ timeout : int, default 45
1083
+ Interrupt reporting if it takes more than this many seconds.
1035
1084
 
1036
1085
 
1037
1086
  """
1038
1087
  ...
1039
1088
 
1040
1089
  @typing.overload
1041
- 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]]]:
1090
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1091
+ ...
1092
+
1093
+ @typing.overload
1094
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1095
+ ...
1096
+
1097
+ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
1042
1098
  """
1043
- Enables loading / saving of models within a step.
1099
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1044
1100
 
1101
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1045
1102
 
1046
1103
  Parameters
1047
1104
  ----------
1048
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
1049
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
1050
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
1051
- - `current.checkpoint`
1052
- - `current.model`
1053
- - `current.huggingface_hub`
1105
+ type : str, default 'default'
1106
+ Card type.
1107
+ id : str, optional, default None
1108
+ If multiple cards are present, use this id to identify this card.
1109
+ options : Dict[str, Any], default {}
1110
+ Options passed to the card. The contents depend on the card type.
1111
+ timeout : int, default 45
1112
+ Interrupt reporting if it takes more than this many seconds.
1054
1113
 
1055
- 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
1056
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
1057
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
1058
1114
 
1059
- temp_dir_root : str, default: None
1060
- The root directory under which `current.model.loaded` will store loaded models
1115
+ """
1116
+ ...
1117
+
1118
+ @typing.overload
1119
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1120
+ """
1121
+ Specifies the PyPI packages for all steps of the flow.
1061
1122
 
1123
+ Use `@pypi_base` to set common packages required by all
1124
+ steps and use `@pypi` to specify step-specific overrides.
1125
+ Parameters
1126
+ ----------
1127
+ packages : Dict[str, str], default: {}
1128
+ Packages to use for this flow. The key is the name of the package
1129
+ and the value is the version to use.
1130
+ python : str, optional, default: None
1131
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1132
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1133
+ """
1134
+ ...
1135
+
1136
+ @typing.overload
1137
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1138
+ ...
1139
+
1140
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1141
+ """
1142
+ Specifies the PyPI packages for all steps of the flow.
1062
1143
 
1144
+ Use `@pypi_base` to set common packages required by all
1145
+ steps and use `@pypi` to specify step-specific overrides.
1146
+ Parameters
1147
+ ----------
1148
+ packages : Dict[str, str], default: {}
1149
+ Packages to use for this flow. The key is the name of the package
1150
+ and the value is the version to use.
1151
+ python : str, optional, default: None
1152
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1153
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1154
+ """
1155
+ ...
1156
+
1157
+ 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]]:
1158
+ """
1159
+ 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.
1160
+ 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.
1063
1161
 
1162
+ Parameters
1163
+ ----------
1164
+ timeout : int
1165
+ Time, in seconds before the task times out and fails. (Default: 3600)
1166
+ poke_interval : int
1167
+ Time in seconds that the job should wait in between each try. (Default: 60)
1168
+ mode : str
1169
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1170
+ exponential_backoff : bool
1171
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1172
+ pool : str
1173
+ the slot pool this task should run in,
1174
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1175
+ soft_fail : bool
1176
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1177
+ name : str
1178
+ Name of the sensor on Airflow
1179
+ description : str
1180
+ Description of sensor in the Airflow UI
1181
+ external_dag_id : str
1182
+ The dag_id that contains the task you want to wait for.
1183
+ external_task_ids : List[str]
1184
+ The list of task_ids that you want to wait for.
1185
+ If None (default value) the sensor waits for the DAG. (Default: None)
1186
+ allowed_states : List[str]
1187
+ Iterable of allowed states, (Default: ['success'])
1188
+ failed_states : List[str]
1189
+ Iterable of failed or dis-allowed states. (Default: None)
1190
+ execution_delta : datetime.timedelta
1191
+ time difference with the previous execution to look at,
1192
+ the default is the same logical date as the current task or DAG. (Default: None)
1193
+ check_existence: bool
1194
+ Set to True to check if the external task exists or check if
1195
+ the DAG to wait for exists. (Default: True)
1196
+ """
1197
+ ...
1198
+
1199
+ 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]]:
1200
+ """
1201
+ 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)
1202
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1203
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1204
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1205
+ starts only after all sensors finish.
1206
+
1207
+ Parameters
1208
+ ----------
1209
+ timeout : int
1210
+ Time, in seconds before the task times out and fails. (Default: 3600)
1211
+ poke_interval : int
1212
+ Time in seconds that the job should wait in between each try. (Default: 60)
1213
+ mode : str
1214
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1215
+ exponential_backoff : bool
1216
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1217
+ pool : str
1218
+ the slot pool this task should run in,
1219
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1220
+ soft_fail : bool
1221
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1222
+ name : str
1223
+ Name of the sensor on Airflow
1224
+ description : str
1225
+ Description of sensor in the Airflow UI
1226
+ bucket_key : Union[str, List[str]]
1227
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1228
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1229
+ bucket_name : str
1230
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1231
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1232
+ wildcard_match : bool
1233
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1234
+ aws_conn_id : str
1235
+ a reference to the s3 connection on Airflow. (Default: None)
1236
+ verify : bool
1237
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1064
1238
  """
1065
1239
  ...
1066
1240
 
1067
- @typing.overload
1068
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1069
- ...
1070
-
1071
- @typing.overload
1072
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1073
- ...
1074
-
1075
- 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):
1241
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1076
1242
  """
1077
- Enables loading / saving of models within a step.
1243
+ Specifies what flows belong to the same project.
1078
1244
 
1245
+ A project-specific namespace is created for all flows that
1246
+ use the same `@project(name)`.
1079
1247
 
1080
1248
  Parameters
1081
1249
  ----------
1082
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
1083
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
1084
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
1085
- - `current.checkpoint`
1086
- - `current.model`
1087
- - `current.huggingface_hub`
1088
-
1089
- 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
1090
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
1091
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
1092
-
1093
- temp_dir_root : str, default: None
1094
- The root directory under which `current.model.loaded` will store loaded models
1095
-
1250
+ name : str
1251
+ Project name. Make sure that the name is unique amongst all
1252
+ projects that use the same production scheduler. The name may
1253
+ contain only lowercase alphanumeric characters and underscores.
1096
1254
 
1097
1255
 
1098
1256
  """
1099
1257
  ...
1100
1258
 
1101
- @typing.overload
1102
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1103
- """
1104
- Internal decorator to support Fast bakery
1105
- """
1106
- ...
1107
-
1108
- @typing.overload
1109
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1110
- ...
1111
-
1112
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1113
- """
1114
- Internal decorator to support Fast bakery
1115
- """
1116
- ...
1117
-
1118
1259
  @typing.overload
1119
1260
  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]]:
1120
1261
  """
@@ -1259,87 +1400,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1259
1400
  """
1260
1401
  ...
1261
1402
 
1262
- 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]]:
1263
- """
1264
- 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)
1265
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1266
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1267
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1268
- starts only after all sensors finish.
1269
-
1270
- Parameters
1271
- ----------
1272
- timeout : int
1273
- Time, in seconds before the task times out and fails. (Default: 3600)
1274
- poke_interval : int
1275
- Time in seconds that the job should wait in between each try. (Default: 60)
1276
- mode : str
1277
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1278
- exponential_backoff : bool
1279
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1280
- pool : str
1281
- the slot pool this task should run in,
1282
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1283
- soft_fail : bool
1284
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1285
- name : str
1286
- Name of the sensor on Airflow
1287
- description : str
1288
- Description of sensor in the Airflow UI
1289
- bucket_key : Union[str, List[str]]
1290
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1291
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1292
- bucket_name : str
1293
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1294
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1295
- wildcard_match : bool
1296
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1297
- aws_conn_id : str
1298
- a reference to the s3 connection on Airflow. (Default: None)
1299
- verify : bool
1300
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1301
- """
1302
- ...
1303
-
1304
- @typing.overload
1305
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1306
- """
1307
- Specifies the PyPI packages for all steps of the flow.
1308
-
1309
- Use `@pypi_base` to set common packages required by all
1310
- steps and use `@pypi` to specify step-specific overrides.
1311
- Parameters
1312
- ----------
1313
- packages : Dict[str, str], default: {}
1314
- Packages to use for this flow. The key is the name of the package
1315
- and the value is the version to use.
1316
- python : str, optional, default: None
1317
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1318
- that the version used will correspond to the version of the Python interpreter used to start the run.
1319
- """
1320
- ...
1321
-
1322
- @typing.overload
1323
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1324
- ...
1325
-
1326
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1327
- """
1328
- Specifies the PyPI packages for all steps of the flow.
1329
-
1330
- Use `@pypi_base` to set common packages required by all
1331
- steps and use `@pypi` to specify step-specific overrides.
1332
- Parameters
1333
- ----------
1334
- packages : Dict[str, str], default: {}
1335
- Packages to use for this flow. The key is the name of the package
1336
- and the value is the version to use.
1337
- python : str, optional, default: None
1338
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1339
- that the version used will correspond to the version of the Python interpreter used to start the run.
1340
- """
1341
- ...
1342
-
1343
1403
  @typing.overload
1344
1404
  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]]:
1345
1405
  """
@@ -1389,6 +1449,37 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1389
1449
  """
1390
1450
  ...
1391
1451
 
1452
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1453
+ """
1454
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1455
+
1456
+ User code call
1457
+ -----------
1458
+ @nim(
1459
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1460
+ backend='managed'
1461
+ )
1462
+
1463
+ Valid backend options
1464
+ ---------------------
1465
+ - 'managed': Outerbounds selects a compute provider based on the model.
1466
+ - 🚧 'dataplane': Run in your account.
1467
+
1468
+ Valid model options
1469
+ ----------------
1470
+ - 'meta/llama3-8b-instruct': 8B parameter model
1471
+ - 'meta/llama3-70b-instruct': 70B parameter model
1472
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1473
+
1474
+ Parameters
1475
+ ----------
1476
+ models: list[NIM]
1477
+ List of NIM containers running models in sidecars.
1478
+ backend: str
1479
+ Compute provider to run the NIM container.
1480
+ """
1481
+ ...
1482
+
1392
1483
  @typing.overload
1393
1484
  def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1394
1485
  """
@@ -1492,97 +1583,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1492
1583
  """
1493
1584
  ...
1494
1585
 
1495
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1496
- """
1497
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1498
-
1499
- User code call
1500
- -----------
1501
- @nim(
1502
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1503
- backend='managed'
1504
- )
1505
-
1506
- Valid backend options
1507
- ---------------------
1508
- - 'managed': Outerbounds selects a compute provider based on the model.
1509
- - 🚧 'dataplane': Run in your account.
1510
-
1511
- Valid model options
1512
- ----------------
1513
- - 'meta/llama3-8b-instruct': 8B parameter model
1514
- - 'meta/llama3-70b-instruct': 70B parameter model
1515
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1516
-
1517
- Parameters
1518
- ----------
1519
- models: list[NIM]
1520
- List of NIM containers running models in sidecars.
1521
- backend: str
1522
- Compute provider to run the NIM container.
1523
- """
1524
- ...
1525
-
1526
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1527
- """
1528
- Specifies what flows belong to the same project.
1529
-
1530
- A project-specific namespace is created for all flows that
1531
- use the same `@project(name)`.
1532
-
1533
- Parameters
1534
- ----------
1535
- name : str
1536
- Project name. Make sure that the name is unique amongst all
1537
- projects that use the same production scheduler. The name may
1538
- contain only lowercase alphanumeric characters and underscores.
1539
-
1540
-
1541
- """
1542
- ...
1543
-
1544
- 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]]:
1545
- """
1546
- 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.
1547
- 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.
1548
-
1549
- Parameters
1550
- ----------
1551
- timeout : int
1552
- Time, in seconds before the task times out and fails. (Default: 3600)
1553
- poke_interval : int
1554
- Time in seconds that the job should wait in between each try. (Default: 60)
1555
- mode : str
1556
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1557
- exponential_backoff : bool
1558
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1559
- pool : str
1560
- the slot pool this task should run in,
1561
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1562
- soft_fail : bool
1563
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1564
- name : str
1565
- Name of the sensor on Airflow
1566
- description : str
1567
- Description of sensor in the Airflow UI
1568
- external_dag_id : str
1569
- The dag_id that contains the task you want to wait for.
1570
- external_task_ids : List[str]
1571
- The list of task_ids that you want to wait for.
1572
- If None (default value) the sensor waits for the DAG. (Default: None)
1573
- allowed_states : List[str]
1574
- Iterable of allowed states, (Default: ['success'])
1575
- failed_states : List[str]
1576
- Iterable of failed or dis-allowed states. (Default: None)
1577
- execution_delta : datetime.timedelta
1578
- time difference with the previous execution to look at,
1579
- the default is the same logical date as the current task or DAG. (Default: None)
1580
- check_existence: bool
1581
- Set to True to check if the external task exists or check if
1582
- the DAG to wait for exists. (Default: True)
1583
- """
1584
- ...
1585
-
1586
1586
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1587
1587
  """
1588
1588
  Switch namespace to the one provided.