ob-metaflow-stubs 6.0.3.102rc4__py2.py3-none-any.whl → 6.0.3.102rc6__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 +412 -412
  2. metaflow-stubs/cards.pyi +3 -3
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +5 -5
  6. metaflow-stubs/client/filecache.pyi +1 -1
  7. metaflow-stubs/clone_util.pyi +1 -1
  8. metaflow-stubs/events.pyi +2 -2
  9. metaflow-stubs/exception.pyi +1 -1
  10. metaflow-stubs/flowspec.pyi +5 -5
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +2 -2
  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 +4 -4
  18. metaflow-stubs/mflog/mflog.pyi +1 -1
  19. metaflow-stubs/multicore_utils.pyi +1 -1
  20. metaflow-stubs/parameters.pyi +2 -2
  21. metaflow-stubs/plugins/__init__.pyi +1 -1
  22. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  23. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  24. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  25. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  26. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
  27. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +1 -1
  28. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +1 -1
  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 +5 -5
  34. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +6 -6
  35. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +2 -2
  62. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  63. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  64. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  66. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  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 +2 -2
  72. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  73. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  74. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  75. metaflow-stubs/plugins/catch_decorator.pyi +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 +5 -5
  80. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  81. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  82. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  83. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  84. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  85. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  86. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  87. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  88. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  89. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +1 -1
  90. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  91. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  92. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  93. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  94. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  95. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +1 -1
  96. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  97. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +1 -1
  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 +1 -1
  102. metaflow-stubs/plugins/package_cli.pyi +1 -1
  103. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  104. metaflow-stubs/plugins/perimeters.pyi +1 -1
  105. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  106. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  107. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  108. metaflow-stubs/plugins/pypi/conda_environment.pyi +2 -2
  109. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  110. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  111. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  112. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  113. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  114. metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
  115. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +1 -1
  116. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  117. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  118. metaflow-stubs/plugins/tag_cli.pyi +3 -3
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
  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 +2 -2
  126. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  127. metaflow-stubs/runner/nbdeploy.pyi +1 -1
  128. metaflow-stubs/runner/nbrun.pyi +1 -1
  129. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  130. metaflow-stubs/runner/utils.pyi +1 -1
  131. metaflow-stubs/system/__init__.pyi +2 -2
  132. metaflow-stubs/system/system_logger.pyi +2 -2
  133. metaflow-stubs/system/system_monitor.pyi +1 -1
  134. metaflow-stubs/tagging_util.pyi +1 -1
  135. metaflow-stubs/tuple_util.pyi +1 -1
  136. {ob_metaflow_stubs-6.0.3.102rc4.dist-info → ob_metaflow_stubs-6.0.3.102rc6.dist-info}/METADATA +1 -1
  137. ob_metaflow_stubs-6.0.3.102rc6.dist-info/RECORD +140 -0
  138. ob_metaflow_stubs-6.0.3.102rc4.dist-info/RECORD +0 -140
  139. {ob_metaflow_stubs-6.0.3.102rc4.dist-info → ob_metaflow_stubs-6.0.3.102rc6.dist-info}/WHEEL +0 -0
  140. {ob_metaflow_stubs-6.0.3.102rc4.dist-info → ob_metaflow_stubs-6.0.3.102rc6.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,24 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.22.1+obcheckpoint(0.0.10);ob(v1) #
4
- # Generated on 2024-09-20T19:06:14.547638 #
4
+ # Generated on 2024-09-20T19:23:06.789979 #
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.runner.metaflow_runner
11
+ import datetime
12
12
  import metaflow.parameters
13
- import metaflow.flowspec
14
- import metaflow.datastore.inputs
15
13
  import metaflow.events
16
- import metaflow.client.core
17
14
  import metaflow._vendor.click.types
18
15
  import typing
19
- import metaflow.metaflow_current
20
- import datetime
16
+ import metaflow.client.core
17
+ import metaflow.datastore.inputs
18
+ import metaflow.flowspec
21
19
  import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
20
+ import metaflow.metaflow_current
21
+ import metaflow.runner.metaflow_runner
22
22
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
23
23
  StepFlag = typing.NewType("StepFlag", bool)
24
24
 
@@ -435,51 +435,215 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
435
435
  ...
436
436
 
437
437
  @typing.overload
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]]]:
438
+ def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
439
439
  """
440
- Specifies the PyPI packages for the step.
440
+ Specifies a timeout for your step.
441
+
442
+ This decorator is useful if this step may hang indefinitely.
443
+
444
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
445
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
446
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
447
+
448
+ Note that all the values specified in parameters are added together so if you specify
449
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
450
+
451
+ Parameters
452
+ ----------
453
+ seconds : int, default 0
454
+ Number of seconds to wait prior to timing out.
455
+ minutes : int, default 0
456
+ Number of minutes to wait prior to timing out.
457
+ hours : int, default 0
458
+ Number of hours to wait prior to timing out.
459
+ """
460
+ ...
461
+
462
+ @typing.overload
463
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
464
+ ...
465
+
466
+ @typing.overload
467
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
468
+ ...
469
+
470
+ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
471
+ """
472
+ Specifies a timeout for your step.
473
+
474
+ This decorator is useful if this step may hang indefinitely.
475
+
476
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
477
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
478
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
479
+
480
+ Note that all the values specified in parameters are added together so if you specify
481
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
482
+
483
+ Parameters
484
+ ----------
485
+ seconds : int, default 0
486
+ Number of seconds to wait prior to timing out.
487
+ minutes : int, default 0
488
+ Number of minutes to wait prior to timing out.
489
+ hours : int, default 0
490
+ Number of hours to wait prior to timing out.
491
+ """
492
+ ...
493
+
494
+ @typing.overload
495
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
496
+ """
497
+ Specifies secrets to be retrieved and injected as environment variables prior to
498
+ the execution of a step.
499
+
500
+ Parameters
501
+ ----------
502
+ sources : List[Union[str, Dict[str, Any]]], default: []
503
+ List of secret specs, defining how the secrets are to be retrieved
504
+ """
505
+ ...
506
+
507
+ @typing.overload
508
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
509
+ ...
510
+
511
+ @typing.overload
512
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
513
+ ...
514
+
515
+ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []):
516
+ """
517
+ Specifies secrets to be retrieved and injected as environment variables prior to
518
+ the execution of a step.
519
+
520
+ Parameters
521
+ ----------
522
+ sources : List[Union[str, Dict[str, Any]]], default: []
523
+ List of secret specs, defining how the secrets are to be retrieved
524
+ """
525
+ ...
526
+
527
+ @typing.overload
528
+ def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
529
+ """
530
+ Specifies the Conda environment for the step.
441
531
 
442
532
  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.
533
+ attributes set in the `@conda_base` flow-level decorator. Hence,
534
+ you can use `@conda_base` to set packages required by all
535
+ steps and use `@conda` to specify step-specific overrides.
446
536
 
447
537
  Parameters
448
538
  ----------
449
- packages : Dict[str, str], default: {}
539
+ packages : Dict[str, str], default {}
450
540
  Packages to use for this step. The key is the name of the package
451
541
  and the value is the version to use.
452
- python : str, optional, default: None
542
+ libraries : Dict[str, str], default {}
543
+ Supported for backward compatibility. When used with packages, packages will take precedence.
544
+ python : str, optional, default None
453
545
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
454
546
  that the version used will correspond to the version of the Python interpreter used to start the run.
547
+ disabled : bool, default False
548
+ If set to True, disables @conda.
455
549
  """
456
550
  ...
457
551
 
458
552
  @typing.overload
459
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
553
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
460
554
  ...
461
555
 
462
556
  @typing.overload
463
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
557
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
464
558
  ...
465
559
 
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):
560
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
467
561
  """
468
- Specifies the PyPI packages for the step.
562
+ Specifies the Conda environment for the step.
469
563
 
470
564
  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.
565
+ attributes set in the `@conda_base` flow-level decorator. Hence,
566
+ you can use `@conda_base` to set packages required by all
567
+ steps and use `@conda` to specify step-specific overrides.
474
568
 
475
569
  Parameters
476
570
  ----------
477
- packages : Dict[str, str], default: {}
571
+ packages : Dict[str, str], default {}
478
572
  Packages to use for this step. The key is the name of the package
479
573
  and the value is the version to use.
480
- python : str, optional, default: None
574
+ libraries : Dict[str, str], default {}
575
+ Supported for backward compatibility. When used with packages, packages will take precedence.
576
+ python : str, optional, default None
481
577
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
482
578
  that the version used will correspond to the version of the Python interpreter used to start the run.
579
+ disabled : bool, default False
580
+ If set to True, disables @conda.
581
+ """
582
+ ...
583
+
584
+ @typing.overload
585
+ def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
586
+ """
587
+ Specifies that the step will success under all circumstances.
588
+
589
+ The decorator will create an optional artifact, specified by `var`, which
590
+ contains the exception raised. You can use it to detect the presence
591
+ of errors, indicating that all happy-path artifacts produced by the step
592
+ are missing.
593
+
594
+ Parameters
595
+ ----------
596
+ var : str, optional, default None
597
+ Name of the artifact in which to store the caught exception.
598
+ If not specified, the exception is not stored.
599
+ print_exception : bool, default True
600
+ Determines whether or not the exception is printed to
601
+ stdout when caught.
602
+ """
603
+ ...
604
+
605
+ @typing.overload
606
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
607
+ ...
608
+
609
+ @typing.overload
610
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
611
+ ...
612
+
613
+ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
614
+ """
615
+ Specifies that the step will success under all circumstances.
616
+
617
+ The decorator will create an optional artifact, specified by `var`, which
618
+ contains the exception raised. You can use it to detect the presence
619
+ of errors, indicating that all happy-path artifacts produced by the step
620
+ are missing.
621
+
622
+ Parameters
623
+ ----------
624
+ var : str, optional, default None
625
+ Name of the artifact in which to store the caught exception.
626
+ If not specified, the exception is not stored.
627
+ print_exception : bool, default True
628
+ Determines whether or not the exception is printed to
629
+ stdout when caught.
630
+ """
631
+ ...
632
+
633
+ @typing.overload
634
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
635
+ """
636
+ Internal decorator to support Fast bakery
637
+ """
638
+ ...
639
+
640
+ @typing.overload
641
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
642
+ ...
643
+
644
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
645
+ """
646
+ Internal decorator to support Fast bakery
483
647
  """
484
648
  ...
485
649
 
@@ -544,23 +708,6 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
544
708
  """
545
709
  ...
546
710
 
547
- @typing.overload
548
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
549
- """
550
- Internal decorator to support Fast bakery
551
- """
552
- ...
553
-
554
- @typing.overload
555
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
556
- ...
557
-
558
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
559
- """
560
- Internal decorator to support Fast bakery
561
- """
562
- ...
563
-
564
711
  @typing.overload
565
712
  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]]]:
566
713
  """
@@ -593,145 +740,51 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
593
740
  ...
594
741
 
595
742
  @typing.overload
596
- 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]]]:
743
+ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
597
744
  """
598
- Specifies secrets to be retrieved and injected as environment variables prior to
599
- the execution of a step.
745
+ Specifies the PyPI packages for the step.
746
+
747
+ Information in this decorator will augment any
748
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
749
+ you can use `@pypi_base` to set packages required by all
750
+ steps and use `@pypi` to specify step-specific overrides.
600
751
 
601
752
  Parameters
602
753
  ----------
603
- sources : List[Union[str, Dict[str, Any]]], default: []
604
- List of secret specs, defining how the secrets are to be retrieved
754
+ packages : Dict[str, str], default: {}
755
+ Packages to use for this step. The key is the name of the package
756
+ and the value is the version to use.
757
+ python : str, optional, default: None
758
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
759
+ that the version used will correspond to the version of the Python interpreter used to start the run.
605
760
  """
606
761
  ...
607
762
 
608
763
  @typing.overload
609
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
764
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
610
765
  ...
611
766
 
612
767
  @typing.overload
613
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
768
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
614
769
  ...
615
770
 
616
- 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]]] = []):
771
+ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
617
772
  """
618
- Specifies secrets to be retrieved and injected as environment variables prior to
619
- the execution of a step.
773
+ Specifies the PyPI packages for the step.
620
774
 
621
- Parameters
622
- ----------
623
- sources : List[Union[str, Dict[str, Any]]], default: []
624
- List of secret specs, defining how the secrets are to be retrieved
625
- """
626
- ...
627
-
628
- @typing.overload
629
- 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]]]:
630
- """
631
- Enables checkpointing for a step.
632
-
633
-
634
- Parameters
635
- ----------
636
- load_policy : str, default: "fresh"
637
- The policy for loading the checkpoint. The following policies are supported:
638
- - "eager": Loads the the latest available checkpoint within the namespace.
639
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
640
- will be loaded at the start of the task.
641
- - "none": Do not load any checkpoint
642
- - "fresh": Loads the lastest checkpoint created within the running Task.
643
- This mode helps loading checkpoints across various retry attempts of the same task.
644
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
645
- created within the task will be loaded when the task is retries execution on failure.
646
-
647
- temp_dir_root : str, default: None
648
- The root directory under which `current.checkpoint.directory` will be created.
649
-
650
-
651
-
652
- """
653
- ...
654
-
655
- @typing.overload
656
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
657
- ...
658
-
659
- @typing.overload
660
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
661
- ...
662
-
663
- 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):
664
- """
665
- Enables checkpointing for a step.
666
-
667
-
668
- Parameters
669
- ----------
670
- load_policy : str, default: "fresh"
671
- The policy for loading the checkpoint. The following policies are supported:
672
- - "eager": Loads the the latest available checkpoint within the namespace.
673
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
674
- will be loaded at the start of the task.
675
- - "none": Do not load any checkpoint
676
- - "fresh": Loads the lastest checkpoint created within the running Task.
677
- This mode helps loading checkpoints across various retry attempts of the same task.
678
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
679
- created within the task will be loaded when the task is retries execution on failure.
680
-
681
- temp_dir_root : str, default: None
682
- The root directory under which `current.checkpoint.directory` will be created.
683
-
684
-
685
-
686
- """
687
- ...
688
-
689
- @typing.overload
690
- 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]]]:
691
- """
692
- Specifies that the step will success under all circumstances.
693
-
694
- The decorator will create an optional artifact, specified by `var`, which
695
- contains the exception raised. You can use it to detect the presence
696
- of errors, indicating that all happy-path artifacts produced by the step
697
- are missing.
698
-
699
- Parameters
700
- ----------
701
- var : str, optional, default None
702
- Name of the artifact in which to store the caught exception.
703
- If not specified, the exception is not stored.
704
- print_exception : bool, default True
705
- Determines whether or not the exception is printed to
706
- stdout when caught.
707
- """
708
- ...
709
-
710
- @typing.overload
711
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
712
- ...
713
-
714
- @typing.overload
715
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
716
- ...
717
-
718
- 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):
719
- """
720
- Specifies that the step will success under all circumstances.
721
-
722
- The decorator will create an optional artifact, specified by `var`, which
723
- contains the exception raised. You can use it to detect the presence
724
- of errors, indicating that all happy-path artifacts produced by the step
725
- are missing.
775
+ Information in this decorator will augment any
776
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
777
+ you can use `@pypi_base` to set packages required by all
778
+ steps and use `@pypi` to specify step-specific overrides.
726
779
 
727
780
  Parameters
728
781
  ----------
729
- var : str, optional, default None
730
- Name of the artifact in which to store the caught exception.
731
- If not specified, the exception is not stored.
732
- print_exception : bool, default True
733
- Determines whether or not the exception is printed to
734
- stdout when caught.
782
+ packages : Dict[str, str], default: {}
783
+ Packages to use for this step. The key is the name of the package
784
+ and the value is the version to use.
785
+ python : str, optional, default: None
786
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
787
+ that the version used will correspond to the version of the Python interpreter used to start the run.
735
788
  """
736
789
  ...
737
790
 
@@ -802,127 +855,61 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
802
855
  ...
803
856
 
804
857
  @typing.overload
805
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
806
- """
807
- Decorator prototype for all step decorators. This function gets specialized
808
- and imported for all decorators types by _import_plugin_decorators().
809
- """
810
- ...
811
-
812
- @typing.overload
813
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
814
- ...
815
-
816
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
817
- """
818
- Decorator prototype for all step decorators. This function gets specialized
819
- and imported for all decorators types by _import_plugin_decorators().
820
- """
821
- ...
822
-
823
- @typing.overload
824
- 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]]]:
825
- """
826
- Specifies the Conda environment for the step.
827
-
828
- Information in this decorator will augment any
829
- attributes set in the `@conda_base` flow-level decorator. Hence,
830
- you can use `@conda_base` to set packages required by all
831
- steps and use `@conda` to specify step-specific overrides.
832
-
833
- Parameters
834
- ----------
835
- packages : Dict[str, str], default {}
836
- Packages to use for this step. The key is the name of the package
837
- and the value is the version to use.
838
- libraries : Dict[str, str], default {}
839
- Supported for backward compatibility. When used with packages, packages will take precedence.
840
- python : str, optional, default None
841
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
842
- that the version used will correspond to the version of the Python interpreter used to start the run.
843
- disabled : bool, default False
844
- If set to True, disables @conda.
845
- """
846
- ...
847
-
848
- @typing.overload
849
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
850
- ...
851
-
852
- @typing.overload
853
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
854
- ...
855
-
856
- 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):
858
+ def checkpoint(*, load_policy: str = "fresh", temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
857
859
  """
858
- Specifies the Conda environment for the step.
860
+ Enables checkpointing for a step.
859
861
 
860
- Information in this decorator will augment any
861
- attributes set in the `@conda_base` flow-level decorator. Hence,
862
- you can use `@conda_base` to set packages required by all
863
- steps and use `@conda` to specify step-specific overrides.
864
862
 
865
863
  Parameters
866
864
  ----------
867
- packages : Dict[str, str], default {}
868
- Packages to use for this step. The key is the name of the package
869
- and the value is the version to use.
870
- libraries : Dict[str, str], default {}
871
- Supported for backward compatibility. When used with packages, packages will take precedence.
872
- python : str, optional, default None
873
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
874
- that the version used will correspond to the version of the Python interpreter used to start the run.
875
- disabled : bool, default False
876
- If set to True, disables @conda.
877
- """
878
- ...
879
-
880
- @typing.overload
881
- 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]]]:
882
- """
883
- Creates a human-readable report, a Metaflow Card, after this step completes.
865
+ load_policy : str, default: "fresh"
866
+ The policy for loading the checkpoint. The following policies are supported:
867
+ - "eager": Loads the the latest available checkpoint within the namespace.
868
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
869
+ will be loaded at the start of the task.
870
+ - "none": Do not load any checkpoint
871
+ - "fresh": Loads the lastest checkpoint created within the running Task.
872
+ This mode helps loading checkpoints across various retry attempts of the same task.
873
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
874
+ created within the task will be loaded when the task is retries execution on failure.
884
875
 
885
- Note that you may add multiple `@card` decorators in a step with different parameters.
876
+ temp_dir_root : str, default: None
877
+ The root directory under which `current.checkpoint.directory` will be created.
886
878
 
887
- Parameters
888
- ----------
889
- type : str, default 'default'
890
- Card type.
891
- id : str, optional, default None
892
- If multiple cards are present, use this id to identify this card.
893
- options : Dict[str, Any], default {}
894
- Options passed to the card. The contents depend on the card type.
895
- timeout : int, default 45
896
- Interrupt reporting if it takes more than this many seconds.
897
879
 
898
880
 
899
881
  """
900
882
  ...
901
883
 
902
884
  @typing.overload
903
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
885
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
904
886
  ...
905
887
 
906
888
  @typing.overload
907
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
889
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
908
890
  ...
909
891
 
910
- 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):
892
+ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = "fresh", temp_dir_root: str = None):
911
893
  """
912
- Creates a human-readable report, a Metaflow Card, after this step completes.
894
+ Enables checkpointing for a step.
913
895
 
914
- Note that you may add multiple `@card` decorators in a step with different parameters.
915
896
 
916
897
  Parameters
917
898
  ----------
918
- type : str, default 'default'
919
- Card type.
920
- id : str, optional, default None
921
- If multiple cards are present, use this id to identify this card.
922
- options : Dict[str, Any], default {}
923
- Options passed to the card. The contents depend on the card type.
924
- timeout : int, default 45
925
- Interrupt reporting if it takes more than this many seconds.
899
+ load_policy : str, default: "fresh"
900
+ The policy for loading the checkpoint. The following policies are supported:
901
+ - "eager": Loads the the latest available checkpoint within the namespace.
902
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
903
+ will be loaded at the start of the task.
904
+ - "none": Do not load any checkpoint
905
+ - "fresh": Loads the lastest checkpoint created within the running Task.
906
+ This mode helps loading checkpoints across various retry attempts of the same task.
907
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
908
+ created within the task will be loaded when the task is retries execution on failure.
909
+
910
+ temp_dir_root : str, default: None
911
+ The root directory under which `current.checkpoint.directory` will be created.
912
+
926
913
 
927
914
 
928
915
  """
@@ -981,6 +968,25 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
981
968
  """
982
969
  ...
983
970
 
971
+ @typing.overload
972
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
973
+ """
974
+ Decorator prototype for all step decorators. This function gets specialized
975
+ and imported for all decorators types by _import_plugin_decorators().
976
+ """
977
+ ...
978
+
979
+ @typing.overload
980
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
981
+ ...
982
+
983
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
984
+ """
985
+ Decorator prototype for all step decorators. This function gets specialized
986
+ and imported for all decorators types by _import_plugin_decorators().
987
+ """
988
+ ...
989
+
984
990
  @typing.overload
985
991
  def resources(*, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
986
992
  """
@@ -1059,59 +1065,53 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1059
1065
  ...
1060
1066
 
1061
1067
  @typing.overload
1062
- 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]]]:
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]]]:
1063
1069
  """
1064
- Specifies a timeout for your step.
1065
-
1066
- This decorator is useful if this step may hang indefinitely.
1067
-
1068
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1069
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1070
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1070
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1071
1071
 
1072
- Note that all the values specified in parameters are added together so if you specify
1073
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1072
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1074
1073
 
1075
1074
  Parameters
1076
1075
  ----------
1077
- seconds : int, default 0
1078
- Number of seconds to wait prior to timing out.
1079
- minutes : int, default 0
1080
- Number of minutes to wait prior to timing out.
1081
- hours : int, default 0
1082
- Number of hours to wait prior to timing out.
1076
+ type : str, default 'default'
1077
+ Card type.
1078
+ id : str, optional, default None
1079
+ If multiple cards are present, use this id to identify this card.
1080
+ options : Dict[str, Any], default {}
1081
+ Options passed to the card. The contents depend on the card type.
1082
+ timeout : int, default 45
1083
+ Interrupt reporting if it takes more than this many seconds.
1084
+
1085
+
1083
1086
  """
1084
1087
  ...
1085
1088
 
1086
1089
  @typing.overload
1087
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1090
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1088
1091
  ...
1089
1092
 
1090
1093
  @typing.overload
1091
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1092
- ...
1093
-
1094
- 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):
1095
- """
1096
- Specifies a timeout for your step.
1097
-
1098
- This decorator is useful if this step may hang indefinitely.
1099
-
1100
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1101
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1102
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
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):
1098
+ """
1099
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1103
1100
 
1104
- Note that all the values specified in parameters are added together so if you specify
1105
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1101
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1106
1102
 
1107
1103
  Parameters
1108
1104
  ----------
1109
- seconds : int, default 0
1110
- Number of seconds to wait prior to timing out.
1111
- minutes : int, default 0
1112
- Number of minutes to wait prior to timing out.
1113
- hours : int, default 0
1114
- Number of hours to wait prior to timing out.
1105
+ type : str, default 'default'
1106
+ Card type.
1107
+ id : str, optional, default None
1108
+ If multiple cards are present, use this id to identify this card.
1109
+ options : Dict[str, Any], default {}
1110
+ Options passed to the card. The contents depend on the card type.
1111
+ timeout : int, default 45
1112
+ Interrupt reporting if it takes more than this many seconds.
1113
+
1114
+
1115
1115
  """
1116
1116
  ...
1117
1117
 
@@ -1218,45 +1218,34 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1218
1218
  """
1219
1219
  ...
1220
1220
 
1221
- 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]]:
1221
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1222
1222
  """
1223
- 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)
1224
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1225
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1226
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1227
- starts only after all sensors finish.
1223
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1224
+
1225
+ User code call
1226
+ -----------
1227
+ @nim(
1228
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1229
+ backend='managed'
1230
+ )
1231
+
1232
+ Valid backend options
1233
+ ---------------------
1234
+ - 'managed': Outerbounds selects a compute provider based on the model.
1235
+ - 🚧 'dataplane': Run in your account.
1236
+
1237
+ Valid model options
1238
+ ----------------
1239
+ - 'meta/llama3-8b-instruct': 8B parameter model
1240
+ - 'meta/llama3-70b-instruct': 70B parameter model
1241
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1228
1242
 
1229
1243
  Parameters
1230
1244
  ----------
1231
- timeout : int
1232
- Time, in seconds before the task times out and fails. (Default: 3600)
1233
- poke_interval : int
1234
- Time in seconds that the job should wait in between each try. (Default: 60)
1235
- mode : str
1236
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1237
- exponential_backoff : bool
1238
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1239
- pool : str
1240
- the slot pool this task should run in,
1241
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1242
- soft_fail : bool
1243
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1244
- name : str
1245
- Name of the sensor on Airflow
1246
- description : str
1247
- Description of sensor in the Airflow UI
1248
- bucket_key : Union[str, List[str]]
1249
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1250
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1251
- bucket_name : str
1252
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1253
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1254
- wildcard_match : bool
1255
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1256
- aws_conn_id : str
1257
- a reference to the s3 connection on Airflow. (Default: None)
1258
- verify : bool
1259
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1245
+ models: list[NIM]
1246
+ List of NIM containers running models in sidecars.
1247
+ backend: str
1248
+ Compute provider to run the NIM container.
1260
1249
  """
1261
1250
  ...
1262
1251
 
@@ -1358,73 +1347,45 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1358
1347
  """
1359
1348
  ...
1360
1349
 
1361
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1362
- """
1363
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1364
-
1365
- User code call
1366
- -----------
1367
- @nim(
1368
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1369
- backend='managed'
1370
- )
1371
-
1372
- Valid backend options
1373
- ---------------------
1374
- - 'managed': Outerbounds selects a compute provider based on the model.
1375
- - 🚧 'dataplane': Run in your account.
1376
-
1377
- Valid model options
1378
- ----------------
1379
- - 'meta/llama3-8b-instruct': 8B parameter model
1380
- - 'meta/llama3-70b-instruct': 70B parameter model
1381
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1382
-
1383
- Parameters
1384
- ----------
1385
- models: list[NIM]
1386
- List of NIM containers running models in sidecars.
1387
- backend: str
1388
- Compute provider to run the NIM container.
1389
- """
1390
- ...
1391
-
1392
- @typing.overload
1393
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1394
- """
1395
- Specifies the PyPI packages for all steps of the flow.
1396
-
1397
- Use `@pypi_base` to set common packages required by all
1398
- steps and use `@pypi` to specify step-specific overrides.
1399
- Parameters
1400
- ----------
1401
- packages : Dict[str, str], default: {}
1402
- Packages to use for this flow. The key is the name of the package
1403
- and the value is the version to use.
1404
- python : str, optional, default: None
1405
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1406
- that the version used will correspond to the version of the Python interpreter used to start the run.
1407
- """
1408
- ...
1409
-
1410
- @typing.overload
1411
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1412
- ...
1413
-
1414
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1350
+ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1415
1351
  """
1416
- Specifies the PyPI packages for all steps of the flow.
1352
+ The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
1353
+ This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1417
1354
 
1418
- Use `@pypi_base` to set common packages required by all
1419
- steps and use `@pypi` to specify step-specific overrides.
1420
1355
  Parameters
1421
1356
  ----------
1422
- packages : Dict[str, str], default: {}
1423
- Packages to use for this flow. The key is the name of the package
1424
- and the value is the version to use.
1425
- python : str, optional, default: None
1426
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1427
- that the version used will correspond to the version of the Python interpreter used to start the run.
1357
+ timeout : int
1358
+ Time, in seconds before the task times out and fails. (Default: 3600)
1359
+ poke_interval : int
1360
+ Time in seconds that the job should wait in between each try. (Default: 60)
1361
+ mode : str
1362
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1363
+ exponential_backoff : bool
1364
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1365
+ pool : str
1366
+ the slot pool this task should run in,
1367
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1368
+ soft_fail : bool
1369
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1370
+ name : str
1371
+ Name of the sensor on Airflow
1372
+ description : str
1373
+ Description of sensor in the Airflow UI
1374
+ external_dag_id : str
1375
+ The dag_id that contains the task you want to wait for.
1376
+ external_task_ids : List[str]
1377
+ The list of task_ids that you want to wait for.
1378
+ If None (default value) the sensor waits for the DAG. (Default: None)
1379
+ allowed_states : List[str]
1380
+ Iterable of allowed states, (Default: ['success'])
1381
+ failed_states : List[str]
1382
+ Iterable of failed or dis-allowed states. (Default: None)
1383
+ execution_delta : datetime.timedelta
1384
+ time difference with the previous execution to look at,
1385
+ the default is the same logical date as the current task or DAG. (Default: None)
1386
+ check_existence: bool
1387
+ Set to True to check if the external task exists or check if
1388
+ the DAG to wait for exists. (Default: True)
1428
1389
  """
1429
1390
  ...
1430
1391
 
@@ -1446,10 +1407,13 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
1446
1407
  """
1447
1408
  ...
1448
1409
 
1449
- 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]]:
1410
+ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1450
1411
  """
1451
- 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.
1452
- 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.
1412
+ The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
1413
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1414
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1415
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1416
+ starts only after all sensors finish.
1453
1417
 
1454
1418
  Parameters
1455
1419
  ----------
@@ -1470,21 +1434,18 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1470
1434
  Name of the sensor on Airflow
1471
1435
  description : str
1472
1436
  Description of sensor in the Airflow UI
1473
- external_dag_id : str
1474
- The dag_id that contains the task you want to wait for.
1475
- external_task_ids : List[str]
1476
- The list of task_ids that you want to wait for.
1477
- If None (default value) the sensor waits for the DAG. (Default: None)
1478
- allowed_states : List[str]
1479
- Iterable of allowed states, (Default: ['success'])
1480
- failed_states : List[str]
1481
- Iterable of failed or dis-allowed states. (Default: None)
1482
- execution_delta : datetime.timedelta
1483
- time difference with the previous execution to look at,
1484
- the default is the same logical date as the current task or DAG. (Default: None)
1485
- check_existence: bool
1486
- Set to True to check if the external task exists or check if
1487
- the DAG to wait for exists. (Default: True)
1437
+ bucket_key : Union[str, List[str]]
1438
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1439
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1440
+ bucket_name : str
1441
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1442
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1443
+ wildcard_match : bool
1444
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1445
+ aws_conn_id : str
1446
+ a reference to the s3 connection on Airflow. (Default: None)
1447
+ verify : bool
1448
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1488
1449
  """
1489
1450
  ...
1490
1451
 
@@ -1583,6 +1544,45 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1583
1544
  """
1584
1545
  ...
1585
1546
 
1547
+ @typing.overload
1548
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1549
+ """
1550
+ Specifies the PyPI packages for all steps of the flow.
1551
+
1552
+ Use `@pypi_base` to set common packages required by all
1553
+ steps and use `@pypi` to specify step-specific overrides.
1554
+ Parameters
1555
+ ----------
1556
+ packages : Dict[str, str], default: {}
1557
+ Packages to use for this flow. The key is the name of the package
1558
+ and the value is the version to use.
1559
+ python : str, optional, default: None
1560
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1561
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1562
+ """
1563
+ ...
1564
+
1565
+ @typing.overload
1566
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1567
+ ...
1568
+
1569
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1570
+ """
1571
+ Specifies the PyPI packages for all steps of the flow.
1572
+
1573
+ Use `@pypi_base` to set common packages required by all
1574
+ steps and use `@pypi` to specify step-specific overrides.
1575
+ Parameters
1576
+ ----------
1577
+ packages : Dict[str, str], default: {}
1578
+ Packages to use for this flow. The key is the name of the package
1579
+ and the value is the version to use.
1580
+ python : str, optional, default: None
1581
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1582
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1583
+ """
1584
+ ...
1585
+
1586
1586
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1587
1587
  """
1588
1588
  Switch namespace to the one provided.