metaflow-stubs 2.12.34__py2.py3-none-any.whl → 2.12.35__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 (158) hide show
  1. metaflow-stubs/__init__.pyi +217 -217
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +2 -2
  5. metaflow-stubs/client/core.pyi +4 -4
  6. metaflow-stubs/client/filecache.pyi +3 -3
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +3 -3
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +6 -6
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +4 -4
  13. metaflow-stubs/info_file.pyi +2 -2
  14. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  15. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  16. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  17. metaflow-stubs/metadata_provider/util.pyi +2 -2
  18. metaflow-stubs/metaflow_config.pyi +4 -2
  19. metaflow-stubs/metaflow_current.pyi +5 -5
  20. metaflow-stubs/mflog/__init__.pyi +2 -2
  21. metaflow-stubs/mflog/mflog.pyi +2 -2
  22. metaflow-stubs/multicore_utils.pyi +2 -2
  23. metaflow-stubs/parameters.pyi +4 -4
  24. metaflow-stubs/plugins/__init__.pyi +14 -14
  25. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/airflow.pyi +3 -2
  27. metaflow-stubs/plugins/airflow/airflow_cli.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  29. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  30. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  31. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  32. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  33. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  34. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  35. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  36. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  37. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  38. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -2
  39. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +2 -2
  40. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
  41. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  42. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  43. metaflow-stubs/plugins/aws/__init__.pyi +4 -4
  44. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  45. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  46. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  47. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  48. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  49. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  51. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  52. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  53. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  56. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  58. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  59. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +2 -2
  60. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  64. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  65. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  66. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  67. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  68. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  69. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  70. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  71. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_cli.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
  81. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
  82. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
  83. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
  84. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
  85. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  86. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  87. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  88. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  89. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  90. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  91. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  92. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  93. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  94. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  95. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  96. metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
  97. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  98. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  99. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  100. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  101. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  102. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  103. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  104. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  105. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  106. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  107. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  108. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  109. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  110. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/__init__.pyi +3 -3
  112. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +8 -2
  113. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +5 -5
  114. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +2 -2
  115. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  116. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +8 -2
  117. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +3 -2
  118. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +3 -2
  119. metaflow-stubs/plugins/logs_cli.pyi +2 -2
  120. metaflow-stubs/plugins/package_cli.pyi +2 -2
  121. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  122. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  124. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  125. metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
  126. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  127. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  128. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  129. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  130. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  131. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  132. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +4 -4
  133. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  134. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  135. metaflow-stubs/plugins/tag_cli.pyi +2 -2
  136. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  137. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  138. metaflow-stubs/procpoll.pyi +2 -2
  139. metaflow-stubs/pylint_wrapper.pyi +2 -2
  140. metaflow-stubs/runner/__init__.pyi +2 -2
  141. metaflow-stubs/runner/deployer.pyi +5 -5
  142. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  143. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  144. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  145. metaflow-stubs/runner/nbrun.pyi +2 -2
  146. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  147. metaflow-stubs/runner/utils.pyi +3 -3
  148. metaflow-stubs/system/__init__.pyi +2 -2
  149. metaflow-stubs/system/system_logger.pyi +2 -2
  150. metaflow-stubs/system/system_monitor.pyi +2 -2
  151. metaflow-stubs/tagging_util.pyi +2 -2
  152. metaflow-stubs/tuple_util.pyi +2 -2
  153. metaflow-stubs/version.pyi +2 -2
  154. {metaflow_stubs-2.12.34.dist-info → metaflow_stubs-2.12.35.dist-info}/METADATA +2 -2
  155. metaflow_stubs-2.12.35.dist-info/RECORD +158 -0
  156. metaflow_stubs-2.12.34.dist-info/RECORD +0 -158
  157. {metaflow_stubs-2.12.34.dist-info → metaflow_stubs-2.12.35.dist-info}/WHEEL +0 -0
  158. {metaflow_stubs-2.12.34.dist-info → metaflow_stubs-2.12.35.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.34 #
4
- # Generated on 2024-12-04T14:12:34.722470 #
3
+ # MF version: 2.12.35 #
4
+ # Generated on 2024-12-06T00:07:18.502279 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import typing
12
11
  import datetime
12
+ import typing
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
@@ -29,8 +29,8 @@ from .flowspec import FlowSpec as FlowSpec
29
29
  from .parameters import Parameter as Parameter
30
30
  from .parameters import JSONTypeClass as JSONTypeClass
31
31
  from .parameters import JSONType as JSONType
32
- from . import tuple_util as tuple_util
33
32
  from . import events as events
33
+ from . import tuple_util as tuple_util
34
34
  from . import runner as runner
35
35
  from . import plugins as plugins
36
36
  from .plugins.datatools.s3.s3 import S3 as S3
@@ -156,27 +156,6 @@ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
156
156
  """
157
157
  ...
158
158
 
159
- @typing.overload
160
- 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]]]:
161
- """
162
- Specifies environment variables to be set prior to the execution of a step.
163
- """
164
- ...
165
-
166
- @typing.overload
167
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
168
- ...
169
-
170
- @typing.overload
171
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
172
- ...
173
-
174
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
175
- """
176
- Specifies environment variables to be set prior to the execution of a step.
177
- """
178
- ...
179
-
180
159
  @typing.overload
181
160
  def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
182
161
  """
@@ -217,157 +196,157 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
217
196
  ...
218
197
 
219
198
  @typing.overload
220
- 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]]]:
199
+ 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]]]:
221
200
  """
222
- Specifies that the step will success under all circumstances.
223
-
224
- The decorator will create an optional artifact, specified by `var`, which
225
- contains the exception raised. You can use it to detect the presence
226
- of errors, indicating that all happy-path artifacts produced by the step
227
- are missing.
201
+ Specifies secrets to be retrieved and injected as environment variables prior to
202
+ the execution of a step.
228
203
  """
229
204
  ...
230
205
 
231
206
  @typing.overload
232
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
207
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
233
208
  ...
234
209
 
235
210
  @typing.overload
236
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
211
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
237
212
  ...
238
213
 
239
- 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):
214
+ 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]]] = []):
240
215
  """
241
- Specifies that the step will success under all circumstances.
242
-
243
- The decorator will create an optional artifact, specified by `var`, which
244
- contains the exception raised. You can use it to detect the presence
245
- of errors, indicating that all happy-path artifacts produced by the step
246
- are missing.
216
+ Specifies secrets to be retrieved and injected as environment variables prior to
217
+ the execution of a step.
247
218
  """
248
219
  ...
249
220
 
250
221
  @typing.overload
251
- 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]]]:
222
+ def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, 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]]]:
252
223
  """
253
- Creates a human-readable report, a Metaflow Card, after this step completes.
224
+ Specifies the resources needed when executing this step.
254
225
 
255
- Note that you may add multiple `@card` decorators in a step with different parameters.
226
+ Use `@resources` to specify the resource requirements
227
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
228
+
229
+ You can choose the compute layer on the command line by executing e.g.
230
+ ```
231
+ python myflow.py run --with batch
232
+ ```
233
+ or
234
+ ```
235
+ python myflow.py run --with kubernetes
236
+ ```
237
+ which executes the flow on the desired system using the
238
+ requirements specified in `@resources`.
256
239
  """
257
240
  ...
258
241
 
259
242
  @typing.overload
260
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
243
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
261
244
  ...
262
245
 
263
246
  @typing.overload
264
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
247
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
265
248
  ...
266
249
 
267
- 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):
250
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
268
251
  """
269
- Creates a human-readable report, a Metaflow Card, after this step completes.
252
+ Specifies the resources needed when executing this step.
270
253
 
271
- Note that you may add multiple `@card` decorators in a step with different parameters.
254
+ Use `@resources` to specify the resource requirements
255
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
256
+
257
+ You can choose the compute layer on the command line by executing e.g.
258
+ ```
259
+ python myflow.py run --with batch
260
+ ```
261
+ or
262
+ ```
263
+ python myflow.py run --with kubernetes
264
+ ```
265
+ which executes the flow on the desired system using the
266
+ requirements specified in `@resources`.
272
267
  """
273
268
  ...
274
269
 
275
270
  @typing.overload
276
- 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]]]:
271
+ 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]]]:
277
272
  """
278
- Specifies secrets to be retrieved and injected as environment variables prior to
279
- the execution of a step.
273
+ Specifies the PyPI packages for the step.
274
+
275
+ Information in this decorator will augment any
276
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
277
+ you can use `@pypi_base` to set packages required by all
278
+ steps and use `@pypi` to specify step-specific overrides.
280
279
  """
281
280
  ...
282
281
 
283
282
  @typing.overload
284
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
283
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
285
284
  ...
286
285
 
287
286
  @typing.overload
288
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
287
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
289
288
  ...
290
289
 
291
- 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]]] = []):
290
+ 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):
292
291
  """
293
- Specifies secrets to be retrieved and injected as environment variables prior to
294
- the execution of a step.
292
+ Specifies the PyPI packages for the step.
293
+
294
+ Information in this decorator will augment any
295
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
296
+ you can use `@pypi_base` to set packages required by all
297
+ steps and use `@pypi` to specify step-specific overrides.
295
298
  """
296
299
  ...
297
300
 
298
301
  @typing.overload
299
- def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[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]]]:
302
+ 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]]]:
300
303
  """
301
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
304
+ Specifies environment variables to be set prior to the execution of a step.
302
305
  """
303
306
  ...
304
307
 
305
308
  @typing.overload
306
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
309
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
307
310
  ...
308
311
 
309
312
  @typing.overload
310
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
313
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
311
314
  ...
312
315
 
313
- def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None):
316
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
314
317
  """
315
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
318
+ Specifies environment variables to be set prior to the execution of a step.
316
319
  """
317
320
  ...
318
321
 
319
322
  @typing.overload
320
- def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, 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]]]:
323
+ 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]]]:
321
324
  """
322
- Specifies the resources needed when executing this step.
323
-
324
- Use `@resources` to specify the resource requirements
325
- independently of the specific compute layer (`@batch`, `@kubernetes`).
325
+ Specifies that the step will success under all circumstances.
326
326
 
327
- You can choose the compute layer on the command line by executing e.g.
328
- ```
329
- python myflow.py run --with batch
330
- ```
331
- or
332
- ```
333
- python myflow.py run --with kubernetes
334
- ```
335
- which executes the flow on the desired system using the
336
- requirements specified in `@resources`.
327
+ The decorator will create an optional artifact, specified by `var`, which
328
+ contains the exception raised. You can use it to detect the presence
329
+ of errors, indicating that all happy-path artifacts produced by the step
330
+ are missing.
337
331
  """
338
332
  ...
339
333
 
340
334
  @typing.overload
341
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
335
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
342
336
  ...
343
337
 
344
338
  @typing.overload
345
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
339
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
346
340
  ...
347
341
 
348
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
342
+ 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):
349
343
  """
350
- Specifies the resources needed when executing this step.
351
-
352
- Use `@resources` to specify the resource requirements
353
- independently of the specific compute layer (`@batch`, `@kubernetes`).
344
+ Specifies that the step will success under all circumstances.
354
345
 
355
- You can choose the compute layer on the command line by executing e.g.
356
- ```
357
- python myflow.py run --with batch
358
- ```
359
- or
360
- ```
361
- python myflow.py run --with kubernetes
362
- ```
363
- which executes the flow on the desired system using the
364
- requirements specified in `@resources`.
365
- """
366
- ...
367
-
368
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600) -> 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]]]:
369
- """
370
- Specifies that this step should execute on Kubernetes.
346
+ The decorator will create an optional artifact, specified by `var`, which
347
+ contains the exception raised. You can use it to detect the presence
348
+ of errors, indicating that all happy-path artifacts produced by the step
349
+ are missing.
371
350
  """
372
351
  ...
373
352
 
@@ -411,33 +390,54 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
411
390
  ...
412
391
 
413
392
  @typing.overload
414
- 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]]]:
393
+ 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]]]:
415
394
  """
416
- Specifies the PyPI packages for the step.
395
+ Creates a human-readable report, a Metaflow Card, after this step completes.
417
396
 
418
- Information in this decorator will augment any
419
- attributes set in the `@pyi_base` flow-level decorator. Hence,
420
- you can use `@pypi_base` to set packages required by all
421
- steps and use `@pypi` to specify step-specific overrides.
397
+ Note that you may add multiple `@card` decorators in a step with different parameters.
422
398
  """
423
399
  ...
424
400
 
425
401
  @typing.overload
426
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
402
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
427
403
  ...
428
404
 
429
405
  @typing.overload
430
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
406
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
431
407
  ...
432
408
 
433
- 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):
409
+ 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):
434
410
  """
435
- Specifies the PyPI packages for the step.
411
+ Creates a human-readable report, a Metaflow Card, after this step completes.
436
412
 
437
- Information in this decorator will augment any
438
- attributes set in the `@pyi_base` flow-level decorator. Hence,
439
- you can use `@pypi_base` to set packages required by all
440
- steps and use `@pypi` to specify step-specific overrides.
413
+ Note that you may add multiple `@card` decorators in a step with different parameters.
414
+ """
415
+ ...
416
+
417
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable') -> 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]]]:
418
+ """
419
+ Specifies that this step should execute on Kubernetes.
420
+ """
421
+ ...
422
+
423
+ @typing.overload
424
+ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[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]]]:
425
+ """
426
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
427
+ """
428
+ ...
429
+
430
+ @typing.overload
431
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
432
+ ...
433
+
434
+ @typing.overload
435
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
436
+ ...
437
+
438
+ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None):
439
+ """
440
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
441
441
  """
442
442
  ...
443
443
 
@@ -492,205 +492,196 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
492
492
  ...
493
493
 
494
494
  @typing.overload
495
- 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]]:
495
+ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
496
496
  """
497
- Specifies the flow(s) that this flow depends on.
497
+ Specifies the event(s) that this flow depends on.
498
498
 
499
499
  ```
500
- @trigger_on_finish(flow='FooFlow')
500
+ @trigger(event='foo')
501
501
  ```
502
502
  or
503
503
  ```
504
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
504
+ @trigger(events=['foo', 'bar'])
505
505
  ```
506
- This decorator respects the @project decorator and triggers the flow
507
- when upstream runs within the same namespace complete successfully
508
506
 
509
- Additionally, you can specify project aware upstream flow dependencies
510
- by specifying the fully qualified project_flow_name.
507
+ Additionally, you can specify the parameter mappings
508
+ to map event payload to Metaflow parameters for the flow.
511
509
  ```
512
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
510
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
513
511
  ```
514
512
  or
515
513
  ```
516
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
514
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
515
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
517
516
  ```
518
517
 
519
- You can also specify just the project or project branch (other values will be
520
- inferred from the current project or project branch):
518
+ 'parameters' can also be a list of strings and tuples like so:
521
519
  ```
522
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
520
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
521
+ ```
522
+ This is equivalent to:
523
+ ```
524
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
523
525
  ```
524
-
525
- Note that `branch` is typically one of:
526
- - `prod`
527
- - `user.bob`
528
- - `test.my_experiment`
529
- - `prod.staging`
530
526
  """
531
527
  ...
532
528
 
533
529
  @typing.overload
534
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
530
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
535
531
  ...
536
532
 
537
- def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
533
+ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
538
534
  """
539
- Specifies the flow(s) that this flow depends on.
535
+ Specifies the event(s) that this flow depends on.
540
536
 
541
537
  ```
542
- @trigger_on_finish(flow='FooFlow')
538
+ @trigger(event='foo')
543
539
  ```
544
540
  or
545
541
  ```
546
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
542
+ @trigger(events=['foo', 'bar'])
547
543
  ```
548
- This decorator respects the @project decorator and triggers the flow
549
- when upstream runs within the same namespace complete successfully
550
544
 
551
- Additionally, you can specify project aware upstream flow dependencies
552
- by specifying the fully qualified project_flow_name.
545
+ Additionally, you can specify the parameter mappings
546
+ to map event payload to Metaflow parameters for the flow.
553
547
  ```
554
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
548
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
555
549
  ```
556
550
  or
557
551
  ```
558
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
552
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
553
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
559
554
  ```
560
555
 
561
- You can also specify just the project or project branch (other values will be
562
- inferred from the current project or project branch):
556
+ 'parameters' can also be a list of strings and tuples like so:
563
557
  ```
564
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
558
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
559
+ ```
560
+ This is equivalent to:
561
+ ```
562
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
565
563
  ```
566
-
567
- Note that `branch` is typically one of:
568
- - `prod`
569
- - `user.bob`
570
- - `test.my_experiment`
571
- - `prod.staging`
572
564
  """
573
565
  ...
574
566
 
575
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
567
+ 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]]:
576
568
  """
577
- Specifies what flows belong to the same project.
578
-
579
- A project-specific namespace is created for all flows that
580
- use the same `@project(name)`.
569
+ 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)
570
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
571
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
572
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
573
+ starts only after all sensors finish.
581
574
  """
582
575
  ...
583
576
 
584
- 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]]:
577
+ @typing.overload
578
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
585
579
  """
586
- 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.
587
- 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.
580
+ Specifies the PyPI packages for all steps of the flow.
581
+
582
+ Use `@pypi_base` to set common packages required by all
583
+ steps and use `@pypi` to specify step-specific overrides.
588
584
  """
589
585
  ...
590
586
 
591
- 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]]:
587
+ @typing.overload
588
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
589
+ ...
590
+
591
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
592
592
  """
593
- 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)
594
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
595
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
596
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
597
- starts only after all sensors finish.
593
+ Specifies the PyPI packages for all steps of the flow.
594
+
595
+ Use `@pypi_base` to set common packages required by all
596
+ steps and use `@pypi` to specify step-specific overrides.
598
597
  """
599
598
  ...
600
599
 
601
600
  @typing.overload
602
- def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
601
+ 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]]:
603
602
  """
604
- Specifies the event(s) that this flow depends on.
603
+ Specifies the flow(s) that this flow depends on.
605
604
 
606
605
  ```
607
- @trigger(event='foo')
606
+ @trigger_on_finish(flow='FooFlow')
608
607
  ```
609
608
  or
610
609
  ```
611
- @trigger(events=['foo', 'bar'])
610
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
612
611
  ```
612
+ This decorator respects the @project decorator and triggers the flow
613
+ when upstream runs within the same namespace complete successfully
613
614
 
614
- Additionally, you can specify the parameter mappings
615
- to map event payload to Metaflow parameters for the flow.
615
+ Additionally, you can specify project aware upstream flow dependencies
616
+ by specifying the fully qualified project_flow_name.
616
617
  ```
617
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
618
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
618
619
  ```
619
620
  or
620
621
  ```
621
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
622
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
622
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
623
623
  ```
624
624
 
625
- 'parameters' can also be a list of strings and tuples like so:
626
- ```
627
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
628
- ```
629
- This is equivalent to:
625
+ You can also specify just the project or project branch (other values will be
626
+ inferred from the current project or project branch):
630
627
  ```
631
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
628
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
632
629
  ```
630
+
631
+ Note that `branch` is typically one of:
632
+ - `prod`
633
+ - `user.bob`
634
+ - `test.my_experiment`
635
+ - `prod.staging`
633
636
  """
634
637
  ...
635
638
 
636
639
  @typing.overload
637
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
640
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
638
641
  ...
639
642
 
640
- def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
643
+ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
641
644
  """
642
- Specifies the event(s) that this flow depends on.
645
+ Specifies the flow(s) that this flow depends on.
643
646
 
644
647
  ```
645
- @trigger(event='foo')
648
+ @trigger_on_finish(flow='FooFlow')
646
649
  ```
647
650
  or
648
651
  ```
649
- @trigger(events=['foo', 'bar'])
652
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
650
653
  ```
654
+ This decorator respects the @project decorator and triggers the flow
655
+ when upstream runs within the same namespace complete successfully
651
656
 
652
- Additionally, you can specify the parameter mappings
653
- to map event payload to Metaflow parameters for the flow.
657
+ Additionally, you can specify project aware upstream flow dependencies
658
+ by specifying the fully qualified project_flow_name.
654
659
  ```
655
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
660
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
656
661
  ```
657
662
  or
658
663
  ```
659
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
660
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
664
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
661
665
  ```
662
666
 
663
- 'parameters' can also be a list of strings and tuples like so:
664
- ```
665
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
666
- ```
667
- This is equivalent to:
667
+ You can also specify just the project or project branch (other values will be
668
+ inferred from the current project or project branch):
668
669
  ```
669
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
670
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
670
671
  ```
671
- """
672
- ...
673
-
674
- @typing.overload
675
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
676
- """
677
- Specifies the PyPI packages for all steps of the flow.
678
672
 
679
- Use `@pypi_base` to set common packages required by all
680
- steps and use `@pypi` to specify step-specific overrides.
673
+ Note that `branch` is typically one of:
674
+ - `prod`
675
+ - `user.bob`
676
+ - `test.my_experiment`
677
+ - `prod.staging`
681
678
  """
682
679
  ...
683
680
 
684
- @typing.overload
685
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
686
- ...
687
-
688
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
681
+ 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]]:
689
682
  """
690
- Specifies the PyPI packages for all steps of the flow.
691
-
692
- Use `@pypi_base` to set common packages required by all
693
- steps and use `@pypi` to specify step-specific overrides.
683
+ 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.
684
+ 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.
694
685
  """
695
686
  ...
696
687
 
@@ -717,3 +708,12 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
717
708
  """
718
709
  ...
719
710
 
711
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
712
+ """
713
+ Specifies what flows belong to the same project.
714
+
715
+ A project-specific namespace is created for all flows that
716
+ use the same `@project(name)`.
717
+ """
718
+ ...
719
+