metaflow-stubs 2.15.3__py2.py3-none-any.whl → 2.15.4__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 (146) hide show
  1. metaflow-stubs/__init__.pyi +476 -476
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +4 -4
  8. metaflow-stubs/client/filecache.pyi +3 -3
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +4 -4
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +4 -4
  14. metaflow-stubs/info_file.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +6 -6
  21. metaflow-stubs/multicore_utils.pyi +2 -2
  22. metaflow-stubs/parameters.pyi +4 -4
  23. metaflow-stubs/plugins/__init__.pyi +13 -13
  24. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  29. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  30. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  31. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  32. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  34. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  35. metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
  37. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
  38. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
  39. metaflow-stubs/plugins/aws/__init__.pyi +3 -3
  40. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  41. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  45. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  46. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  47. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  48. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  56. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +2 -2
  57. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  58. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  61. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  62. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  63. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  64. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  66. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  71. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  73. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  77. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  78. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  79. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  80. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  81. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  82. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  83. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  84. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  85. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  86. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  87. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  88. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  89. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  90. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  92. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  93. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  94. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  95. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  96. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  97. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  98. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  100. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  101. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  102. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  103. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  105. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  106. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  107. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  109. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  110. metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
  111. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  112. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  114. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  115. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  116. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  118. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  119. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  121. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  122. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  123. metaflow-stubs/pylint_wrapper.pyi +2 -2
  124. metaflow-stubs/runner/__init__.pyi +2 -2
  125. metaflow-stubs/runner/deployer.pyi +28 -28
  126. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  127. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  128. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  129. metaflow-stubs/runner/nbrun.pyi +2 -2
  130. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  131. metaflow-stubs/runner/utils.pyi +4 -4
  132. metaflow-stubs/system/__init__.pyi +2 -2
  133. metaflow-stubs/system/system_logger.pyi +3 -3
  134. metaflow-stubs/system/system_monitor.pyi +2 -2
  135. metaflow-stubs/tagging_util.pyi +2 -2
  136. metaflow-stubs/tuple_util.pyi +2 -2
  137. metaflow-stubs/user_configs/__init__.pyi +2 -2
  138. metaflow-stubs/user_configs/config_decorators.pyi +5 -5
  139. metaflow-stubs/user_configs/config_options.pyi +3 -3
  140. metaflow-stubs/user_configs/config_parameters.pyi +6 -6
  141. metaflow-stubs/version.pyi +2 -2
  142. {metaflow_stubs-2.15.3.dist-info → metaflow_stubs-2.15.4.dist-info}/METADATA +2 -2
  143. metaflow_stubs-2.15.4.dist-info/RECORD +146 -0
  144. metaflow_stubs-2.15.3.dist-info/RECORD +0 -146
  145. {metaflow_stubs-2.15.3.dist-info → metaflow_stubs-2.15.4.dist-info}/WHEEL +0 -0
  146. {metaflow_stubs-2.15.3.dist-info → metaflow_stubs-2.15.4.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.15.3 #
4
- # Generated on 2025-03-03T18:05:31.392412 #
3
+ # MF version: 2.15.4 #
4
+ # Generated on 2025-03-05T12:14:55.417380 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import datetime
12
11
  import typing
12
+ import datetime
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
@@ -145,6 +145,61 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
145
145
  """
146
146
  ...
147
147
 
148
+ @typing.overload
149
+ 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]]]:
150
+ """
151
+ Specifies the number of times the task corresponding
152
+ to a step needs to be retried.
153
+
154
+ This decorator is useful for handling transient errors, such as networking issues.
155
+ If your task contains operations that can't be retried safely, e.g. database updates,
156
+ it is advisable to annotate it with `@retry(times=0)`.
157
+
158
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
159
+ decorator will execute a no-op task after all retries have been exhausted,
160
+ ensuring that the flow execution can continue.
161
+
162
+
163
+ Parameters
164
+ ----------
165
+ times : int, default 3
166
+ Number of times to retry this task.
167
+ minutes_between_retries : int, default 2
168
+ Number of minutes between retries.
169
+ """
170
+ ...
171
+
172
+ @typing.overload
173
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
174
+ ...
175
+
176
+ @typing.overload
177
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
178
+ ...
179
+
180
+ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
181
+ """
182
+ Specifies the number of times the task corresponding
183
+ to a step needs to be retried.
184
+
185
+ This decorator is useful for handling transient errors, such as networking issues.
186
+ If your task contains operations that can't be retried safely, e.g. database updates,
187
+ it is advisable to annotate it with `@retry(times=0)`.
188
+
189
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
190
+ decorator will execute a no-op task after all retries have been exhausted,
191
+ ensuring that the flow execution can continue.
192
+
193
+
194
+ Parameters
195
+ ----------
196
+ times : int, default 3
197
+ Number of times to retry this task.
198
+ minutes_between_retries : int, default 2
199
+ Number of minutes between retries.
200
+ """
201
+ ...
202
+
148
203
  @typing.overload
149
204
  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]]]:
150
205
  """
@@ -205,193 +260,112 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
205
260
  ...
206
261
 
207
262
  @typing.overload
208
- 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]]]:
263
+ 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]]]:
209
264
  """
210
- Specifies secrets to be retrieved and injected as environment variables prior to
211
- the execution of a step.
265
+ Specifies that the step will success under all circumstances.
266
+
267
+ The decorator will create an optional artifact, specified by `var`, which
268
+ contains the exception raised. You can use it to detect the presence
269
+ of errors, indicating that all happy-path artifacts produced by the step
270
+ are missing.
212
271
 
213
272
 
214
273
  Parameters
215
274
  ----------
216
- sources : List[Union[str, Dict[str, Any]]], default: []
217
- List of secret specs, defining how the secrets are to be retrieved
275
+ var : str, optional, default None
276
+ Name of the artifact in which to store the caught exception.
277
+ If not specified, the exception is not stored.
278
+ print_exception : bool, default True
279
+ Determines whether or not the exception is printed to
280
+ stdout when caught.
218
281
  """
219
282
  ...
220
283
 
221
284
  @typing.overload
222
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
285
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
223
286
  ...
224
287
 
225
288
  @typing.overload
226
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
289
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
227
290
  ...
228
291
 
229
- 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]]] = []):
292
+ 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):
230
293
  """
231
- Specifies secrets to be retrieved and injected as environment variables prior to
232
- the execution of a step.
294
+ Specifies that the step will success under all circumstances.
295
+
296
+ The decorator will create an optional artifact, specified by `var`, which
297
+ contains the exception raised. You can use it to detect the presence
298
+ of errors, indicating that all happy-path artifacts produced by the step
299
+ are missing.
233
300
 
234
301
 
235
302
  Parameters
236
303
  ----------
237
- sources : List[Union[str, Dict[str, Any]]], default: []
238
- List of secret specs, defining how the secrets are to be retrieved
304
+ var : str, optional, default None
305
+ Name of the artifact in which to store the caught exception.
306
+ If not specified, the exception is not stored.
307
+ print_exception : bool, default True
308
+ Determines whether or not the exception is printed to
309
+ stdout when caught.
239
310
  """
240
311
  ...
241
312
 
242
313
  @typing.overload
243
- 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]]]:
314
+ 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]]]:
244
315
  """
245
- Specifies the resources needed when executing this step.
316
+ Specifies a timeout for your step.
246
317
 
247
- Use `@resources` to specify the resource requirements
248
- independently of the specific compute layer (`@batch`, `@kubernetes`).
318
+ This decorator is useful if this step may hang indefinitely.
249
319
 
250
- You can choose the compute layer on the command line by executing e.g.
251
- ```
252
- python myflow.py run --with batch
253
- ```
254
- or
255
- ```
256
- python myflow.py run --with kubernetes
257
- ```
258
- which executes the flow on the desired system using the
259
- requirements specified in `@resources`.
320
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
321
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
322
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
323
+
324
+ Note that all the values specified in parameters are added together so if you specify
325
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
260
326
 
261
327
 
262
328
  Parameters
263
329
  ----------
264
- cpu : int, default 1
265
- Number of CPUs required for this step.
266
- gpu : int, optional, default None
267
- Number of GPUs required for this step.
268
- disk : int, optional, default None
269
- Disk size (in MB) required for this step. Only applies on Kubernetes.
270
- memory : int, default 4096
271
- Memory size (in MB) required for this step.
272
- shared_memory : int, optional, default None
273
- The value for the size (in MiB) of the /dev/shm volume for this step.
274
- This parameter maps to the `--shm-size` option in Docker.
330
+ seconds : int, default 0
331
+ Number of seconds to wait prior to timing out.
332
+ minutes : int, default 0
333
+ Number of minutes to wait prior to timing out.
334
+ hours : int, default 0
335
+ Number of hours to wait prior to timing out.
275
336
  """
276
337
  ...
277
338
 
278
339
  @typing.overload
279
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
340
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
280
341
  ...
281
342
 
282
343
  @typing.overload
283
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
344
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
284
345
  ...
285
346
 
286
- 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):
347
+ 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):
287
348
  """
288
- Specifies the resources needed when executing this step.
289
-
290
- Use `@resources` to specify the resource requirements
291
- independently of the specific compute layer (`@batch`, `@kubernetes`).
349
+ Specifies a timeout for your step.
292
350
 
293
- You can choose the compute layer on the command line by executing e.g.
294
- ```
295
- python myflow.py run --with batch
296
- ```
297
- or
298
- ```
299
- python myflow.py run --with kubernetes
300
- ```
301
- which executes the flow on the desired system using the
302
- requirements specified in `@resources`.
351
+ This decorator is useful if this step may hang indefinitely.
303
352
 
353
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
354
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
355
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
304
356
 
305
- Parameters
306
- ----------
307
- cpu : int, default 1
308
- Number of CPUs required for this step.
309
- gpu : int, optional, default None
310
- Number of GPUs required for this step.
311
- disk : int, optional, default None
312
- Disk size (in MB) required for this step. Only applies on Kubernetes.
313
- memory : int, default 4096
314
- Memory size (in MB) required for this step.
315
- shared_memory : int, optional, default None
316
- The value for the size (in MiB) of the /dev/shm volume for this step.
317
- This parameter maps to the `--shm-size` option in Docker.
318
- """
319
- ...
320
-
321
- 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] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', 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]]]:
322
- """
323
- Specifies that this step should execute on Kubernetes.
357
+ Note that all the values specified in parameters are added together so if you specify
358
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
324
359
 
325
360
 
326
361
  Parameters
327
362
  ----------
328
- cpu : int, default 1
329
- Number of CPUs required for this step. If `@resources` is
330
- also present, the maximum value from all decorators is used.
331
- memory : int, default 4096
332
- Memory size (in MB) required for this step. If
333
- `@resources` is also present, the maximum value from all decorators is
334
- used.
335
- disk : int, default 10240
336
- Disk size (in MB) required for this step. If
337
- `@resources` is also present, the maximum value from all decorators is
338
- used.
339
- image : str, optional, default None
340
- Docker image to use when launching on Kubernetes. If not specified, and
341
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
342
- not, a default Docker image mapping to the current version of Python is used.
343
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
344
- If given, the imagePullPolicy to be applied to the Docker image of the step.
345
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
346
- Kubernetes service account to use when launching pod in Kubernetes.
347
- secrets : List[str], optional, default None
348
- Kubernetes secrets to use when launching pod in Kubernetes. These
349
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
350
- in Metaflow configuration.
351
- node_selector: Union[Dict[str,str], str], optional, default None
352
- Kubernetes node selector(s) to apply to the pod running the task.
353
- Can be passed in as a comma separated string of values e.g.
354
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
355
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
356
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
357
- Kubernetes namespace to use when launching pod in Kubernetes.
358
- gpu : int, optional, default None
359
- Number of GPUs required for this step. A value of zero implies that
360
- the scheduled node should not have GPUs.
361
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
362
- The vendor of the GPUs to be used for this step.
363
- tolerations : List[str], default []
364
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
365
- Kubernetes tolerations to use when launching pod in Kubernetes.
366
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
367
- Kubernetes labels to use when launching pod in Kubernetes.
368
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
369
- Kubernetes annotations to use when launching pod in Kubernetes.
370
- use_tmpfs : bool, default False
371
- This enables an explicit tmpfs mount for this step.
372
- tmpfs_tempdir : bool, default True
373
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
374
- tmpfs_size : int, optional, default: None
375
- The value for the size (in MiB) of the tmpfs mount for this step.
376
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
377
- memory allocated for this step.
378
- tmpfs_path : str, optional, default /metaflow_temp
379
- Path to tmpfs mount for this step.
380
- persistent_volume_claims : Dict[str, str], optional, default None
381
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
382
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
383
- shared_memory: int, optional
384
- Shared memory size (in MiB) required for this step
385
- port: int, optional
386
- Port number to specify in the Kubernetes job object
387
- compute_pool : str, optional, default None
388
- Compute pool to be used for for this step.
389
- If not specified, any accessible compute pool within the perimeter is used.
390
- hostname_resolution_timeout: int, default 10 * 60
391
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
392
- Only applicable when @parallel is used.
393
- qos: str, default: Burstable
394
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
363
+ seconds : int, default 0
364
+ Number of seconds to wait prior to timing out.
365
+ minutes : int, default 0
366
+ Number of minutes to wait prior to timing out.
367
+ hours : int, default 0
368
+ Number of hours to wait prior to timing out.
395
369
  """
396
370
  ...
397
371
 
@@ -447,53 +421,35 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
447
421
  ...
448
422
 
449
423
  @typing.overload
450
- 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]]]:
424
+ 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]]]:
451
425
  """
452
- Specifies that the step will success under all circumstances.
453
-
454
- The decorator will create an optional artifact, specified by `var`, which
455
- contains the exception raised. You can use it to detect the presence
456
- of errors, indicating that all happy-path artifacts produced by the step
457
- are missing.
426
+ Specifies environment variables to be set prior to the execution of a step.
458
427
 
459
428
 
460
429
  Parameters
461
430
  ----------
462
- var : str, optional, default None
463
- Name of the artifact in which to store the caught exception.
464
- If not specified, the exception is not stored.
465
- print_exception : bool, default True
466
- Determines whether or not the exception is printed to
467
- stdout when caught.
431
+ vars : Dict[str, str], default {}
432
+ Dictionary of environment variables to set.
468
433
  """
469
434
  ...
470
435
 
471
436
  @typing.overload
472
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
437
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
473
438
  ...
474
439
 
475
440
  @typing.overload
476
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
441
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
477
442
  ...
478
443
 
479
- 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):
444
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
480
445
  """
481
- Specifies that the step will success under all circumstances.
482
-
483
- The decorator will create an optional artifact, specified by `var`, which
484
- contains the exception raised. You can use it to detect the presence
485
- of errors, indicating that all happy-path artifacts produced by the step
486
- are missing.
446
+ Specifies environment variables to be set prior to the execution of a step.
487
447
 
488
448
 
489
449
  Parameters
490
450
  ----------
491
- var : str, optional, default None
492
- Name of the artifact in which to store the caught exception.
493
- If not specified, the exception is not stored.
494
- print_exception : bool, default True
495
- Determines whether or not the exception is printed to
496
- stdout when caught.
451
+ vars : Dict[str, str], default {}
452
+ Dictionary of environment variables to set.
497
453
  """
498
454
  ...
499
455
 
@@ -546,6 +502,104 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
546
502
  """
547
503
  ...
548
504
 
505
+ @typing.overload
506
+ 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]]]:
507
+ """
508
+ Specifies the resources needed when executing this step.
509
+
510
+ Use `@resources` to specify the resource requirements
511
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
512
+
513
+ You can choose the compute layer on the command line by executing e.g.
514
+ ```
515
+ python myflow.py run --with batch
516
+ ```
517
+ or
518
+ ```
519
+ python myflow.py run --with kubernetes
520
+ ```
521
+ which executes the flow on the desired system using the
522
+ requirements specified in `@resources`.
523
+
524
+
525
+ Parameters
526
+ ----------
527
+ cpu : int, default 1
528
+ Number of CPUs required for this step.
529
+ gpu : int, optional, default None
530
+ Number of GPUs required for this step.
531
+ disk : int, optional, default None
532
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
533
+ memory : int, default 4096
534
+ Memory size (in MB) required for this step.
535
+ shared_memory : int, optional, default None
536
+ The value for the size (in MiB) of the /dev/shm volume for this step.
537
+ This parameter maps to the `--shm-size` option in Docker.
538
+ """
539
+ ...
540
+
541
+ @typing.overload
542
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
543
+ ...
544
+
545
+ @typing.overload
546
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
547
+ ...
548
+
549
+ 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):
550
+ """
551
+ Specifies the resources needed when executing this step.
552
+
553
+ Use `@resources` to specify the resource requirements
554
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
555
+
556
+ You can choose the compute layer on the command line by executing e.g.
557
+ ```
558
+ python myflow.py run --with batch
559
+ ```
560
+ or
561
+ ```
562
+ python myflow.py run --with kubernetes
563
+ ```
564
+ which executes the flow on the desired system using the
565
+ requirements specified in `@resources`.
566
+
567
+
568
+ Parameters
569
+ ----------
570
+ cpu : int, default 1
571
+ Number of CPUs required for this step.
572
+ gpu : int, optional, default None
573
+ Number of GPUs required for this step.
574
+ disk : int, optional, default None
575
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
576
+ memory : int, default 4096
577
+ Memory size (in MB) required for this step.
578
+ shared_memory : int, optional, default None
579
+ The value for the size (in MiB) of the /dev/shm volume for this step.
580
+ This parameter maps to the `--shm-size` option in Docker.
581
+ """
582
+ ...
583
+
584
+ @typing.overload
585
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
586
+ """
587
+ Decorator prototype for all step decorators. This function gets specialized
588
+ and imported for all decorators types by _import_plugin_decorators().
589
+ """
590
+ ...
591
+
592
+ @typing.overload
593
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
594
+ ...
595
+
596
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
597
+ """
598
+ Decorator prototype for all step decorators. This function gets specialized
599
+ and imported for all decorators types by _import_plugin_decorators().
600
+ """
601
+ ...
602
+
549
603
  @typing.overload
550
604
  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]]]:
551
605
  """
@@ -695,169 +749,115 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
695
749
  """
696
750
  ...
697
751
 
698
- @typing.overload
699
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
700
- """
701
- Decorator prototype for all step decorators. This function gets specialized
702
- and imported for all decorators types by _import_plugin_decorators().
703
- """
704
- ...
705
-
706
- @typing.overload
707
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
708
- ...
709
-
710
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
752
+ 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] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', 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]]]:
711
753
  """
712
- Decorator prototype for all step decorators. This function gets specialized
713
- and imported for all decorators types by _import_plugin_decorators().
754
+ Specifies that this step should execute on Kubernetes.
755
+
756
+
757
+ Parameters
758
+ ----------
759
+ cpu : int, default 1
760
+ Number of CPUs required for this step. If `@resources` is
761
+ also present, the maximum value from all decorators is used.
762
+ memory : int, default 4096
763
+ Memory size (in MB) required for this step. If
764
+ `@resources` is also present, the maximum value from all decorators is
765
+ used.
766
+ disk : int, default 10240
767
+ Disk size (in MB) required for this step. If
768
+ `@resources` is also present, the maximum value from all decorators is
769
+ used.
770
+ image : str, optional, default None
771
+ Docker image to use when launching on Kubernetes. If not specified, and
772
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
773
+ not, a default Docker image mapping to the current version of Python is used.
774
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
775
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
776
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
777
+ Kubernetes service account to use when launching pod in Kubernetes.
778
+ secrets : List[str], optional, default None
779
+ Kubernetes secrets to use when launching pod in Kubernetes. These
780
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
781
+ in Metaflow configuration.
782
+ node_selector: Union[Dict[str,str], str], optional, default None
783
+ Kubernetes node selector(s) to apply to the pod running the task.
784
+ Can be passed in as a comma separated string of values e.g.
785
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
786
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
787
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
788
+ Kubernetes namespace to use when launching pod in Kubernetes.
789
+ gpu : int, optional, default None
790
+ Number of GPUs required for this step. A value of zero implies that
791
+ the scheduled node should not have GPUs.
792
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
793
+ The vendor of the GPUs to be used for this step.
794
+ tolerations : List[str], default []
795
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
796
+ Kubernetes tolerations to use when launching pod in Kubernetes.
797
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
798
+ Kubernetes labels to use when launching pod in Kubernetes.
799
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
800
+ Kubernetes annotations to use when launching pod in Kubernetes.
801
+ use_tmpfs : bool, default False
802
+ This enables an explicit tmpfs mount for this step.
803
+ tmpfs_tempdir : bool, default True
804
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
805
+ tmpfs_size : int, optional, default: None
806
+ The value for the size (in MiB) of the tmpfs mount for this step.
807
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
808
+ memory allocated for this step.
809
+ tmpfs_path : str, optional, default /metaflow_temp
810
+ Path to tmpfs mount for this step.
811
+ persistent_volume_claims : Dict[str, str], optional, default None
812
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
813
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
814
+ shared_memory: int, optional
815
+ Shared memory size (in MiB) required for this step
816
+ port: int, optional
817
+ Port number to specify in the Kubernetes job object
818
+ compute_pool : str, optional, default None
819
+ Compute pool to be used for for this step.
820
+ If not specified, any accessible compute pool within the perimeter is used.
821
+ hostname_resolution_timeout: int, default 10 * 60
822
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
823
+ Only applicable when @parallel is used.
824
+ qos: str, default: Burstable
825
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
714
826
  """
715
827
  ...
716
828
 
717
829
  @typing.overload
718
- 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]]]:
830
+ 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]]]:
719
831
  """
720
- Specifies a timeout for your step.
721
-
722
- This decorator is useful if this step may hang indefinitely.
723
-
724
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
725
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
726
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
727
-
728
- Note that all the values specified in parameters are added together so if you specify
729
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
832
+ Specifies secrets to be retrieved and injected as environment variables prior to
833
+ the execution of a step.
730
834
 
731
835
 
732
836
  Parameters
733
837
  ----------
734
- seconds : int, default 0
735
- Number of seconds to wait prior to timing out.
736
- minutes : int, default 0
737
- Number of minutes to wait prior to timing out.
738
- hours : int, default 0
739
- Number of hours to wait prior to timing out.
838
+ sources : List[Union[str, Dict[str, Any]]], default: []
839
+ List of secret specs, defining how the secrets are to be retrieved
740
840
  """
741
841
  ...
742
842
 
743
843
  @typing.overload
744
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
844
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
745
845
  ...
746
846
 
747
847
  @typing.overload
748
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
848
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
749
849
  ...
750
850
 
751
- 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):
851
+ 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]]] = []):
752
852
  """
753
- Specifies a timeout for your step.
754
-
755
- This decorator is useful if this step may hang indefinitely.
756
-
757
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
758
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
759
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
760
-
761
- Note that all the values specified in parameters are added together so if you specify
762
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
853
+ Specifies secrets to be retrieved and injected as environment variables prior to
854
+ the execution of a step.
763
855
 
764
856
 
765
857
  Parameters
766
858
  ----------
767
- seconds : int, default 0
768
- Number of seconds to wait prior to timing out.
769
- minutes : int, default 0
770
- Number of minutes to wait prior to timing out.
771
- hours : int, default 0
772
- Number of hours to wait prior to timing out.
773
- """
774
- ...
775
-
776
- @typing.overload
777
- 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]]]:
778
- """
779
- Specifies the number of times the task corresponding
780
- to a step needs to be retried.
781
-
782
- This decorator is useful for handling transient errors, such as networking issues.
783
- If your task contains operations that can't be retried safely, e.g. database updates,
784
- it is advisable to annotate it with `@retry(times=0)`.
785
-
786
- This can be used in conjunction with the `@catch` decorator. The `@catch`
787
- decorator will execute a no-op task after all retries have been exhausted,
788
- ensuring that the flow execution can continue.
789
-
790
-
791
- Parameters
792
- ----------
793
- times : int, default 3
794
- Number of times to retry this task.
795
- minutes_between_retries : int, default 2
796
- Number of minutes between retries.
797
- """
798
- ...
799
-
800
- @typing.overload
801
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
802
- ...
803
-
804
- @typing.overload
805
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
806
- ...
807
-
808
- def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
809
- """
810
- Specifies the number of times the task corresponding
811
- to a step needs to be retried.
812
-
813
- This decorator is useful for handling transient errors, such as networking issues.
814
- If your task contains operations that can't be retried safely, e.g. database updates,
815
- it is advisable to annotate it with `@retry(times=0)`.
816
-
817
- This can be used in conjunction with the `@catch` decorator. The `@catch`
818
- decorator will execute a no-op task after all retries have been exhausted,
819
- ensuring that the flow execution can continue.
820
-
821
-
822
- Parameters
823
- ----------
824
- times : int, default 3
825
- Number of times to retry this task.
826
- minutes_between_retries : int, default 2
827
- Number of minutes between retries.
828
- """
829
- ...
830
-
831
- @typing.overload
832
- 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]]]:
833
- """
834
- Specifies environment variables to be set prior to the execution of a step.
835
-
836
-
837
- Parameters
838
- ----------
839
- vars : Dict[str, str], default {}
840
- Dictionary of environment variables to set.
841
- """
842
- ...
843
-
844
- @typing.overload
845
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
846
- ...
847
-
848
- @typing.overload
849
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
850
- ...
851
-
852
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
853
- """
854
- Specifies environment variables to be set prior to the execution of a step.
855
-
856
-
857
- Parameters
858
- ----------
859
- vars : Dict[str, str], default {}
860
- Dictionary of environment variables to set.
859
+ sources : List[Union[str, Dict[str, Any]]], default: []
860
+ List of secret specs, defining how the secrets are to be retrieved
861
861
  """
862
862
  ...
863
863
 
@@ -945,96 +945,97 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
945
945
  """
946
946
  ...
947
947
 
948
- @typing.overload
949
- 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]]:
948
+ 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]]:
950
949
  """
951
- Specifies the event(s) that this flow depends on.
952
-
953
- ```
954
- @trigger(event='foo')
955
- ```
956
- or
957
- ```
958
- @trigger(events=['foo', 'bar'])
959
- ```
950
+ 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)
951
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
952
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
953
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
954
+ starts only after all sensors finish.
960
955
 
961
- Additionally, you can specify the parameter mappings
962
- to map event payload to Metaflow parameters for the flow.
963
- ```
964
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
965
- ```
966
- or
967
- ```
968
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
969
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
970
- ```
971
956
 
972
- 'parameters' can also be a list of strings and tuples like so:
973
- ```
974
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
975
- ```
976
- This is equivalent to:
977
- ```
978
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
979
- ```
957
+ Parameters
958
+ ----------
959
+ timeout : int
960
+ Time, in seconds before the task times out and fails. (Default: 3600)
961
+ poke_interval : int
962
+ Time in seconds that the job should wait in between each try. (Default: 60)
963
+ mode : str
964
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
965
+ exponential_backoff : bool
966
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
967
+ pool : str
968
+ the slot pool this task should run in,
969
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
970
+ soft_fail : bool
971
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
972
+ name : str
973
+ Name of the sensor on Airflow
974
+ description : str
975
+ Description of sensor in the Airflow UI
976
+ bucket_key : Union[str, List[str]]
977
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
978
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
979
+ bucket_name : str
980
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
981
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
982
+ wildcard_match : bool
983
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
984
+ aws_conn_id : str
985
+ a reference to the s3 connection on Airflow. (Default: None)
986
+ verify : bool
987
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
988
+ """
989
+ ...
990
+
991
+ @typing.overload
992
+ def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
993
+ """
994
+ Specifies the times when the flow should be run when running on a
995
+ production scheduler.
980
996
 
981
997
 
982
998
  Parameters
983
999
  ----------
984
- event : Union[str, Dict[str, Any]], optional, default None
985
- Event dependency for this flow.
986
- events : List[Union[str, Dict[str, Any]]], default []
987
- Events dependency for this flow.
988
- options : Dict[str, Any], default {}
989
- Backend-specific configuration for tuning eventing behavior.
1000
+ hourly : bool, default False
1001
+ Run the workflow hourly.
1002
+ daily : bool, default True
1003
+ Run the workflow daily.
1004
+ weekly : bool, default False
1005
+ Run the workflow weekly.
1006
+ cron : str, optional, default None
1007
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1008
+ specified by this expression.
1009
+ timezone : str, optional, default None
1010
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1011
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
990
1012
  """
991
1013
  ...
992
1014
 
993
1015
  @typing.overload
994
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1016
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
995
1017
  ...
996
1018
 
997
- 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] = {}):
1019
+ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
998
1020
  """
999
- Specifies the event(s) that this flow depends on.
1000
-
1001
- ```
1002
- @trigger(event='foo')
1003
- ```
1004
- or
1005
- ```
1006
- @trigger(events=['foo', 'bar'])
1007
- ```
1008
-
1009
- Additionally, you can specify the parameter mappings
1010
- to map event payload to Metaflow parameters for the flow.
1011
- ```
1012
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1013
- ```
1014
- or
1015
- ```
1016
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1017
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1018
- ```
1019
-
1020
- 'parameters' can also be a list of strings and tuples like so:
1021
- ```
1022
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1023
- ```
1024
- This is equivalent to:
1025
- ```
1026
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1027
- ```
1021
+ Specifies the times when the flow should be run when running on a
1022
+ production scheduler.
1028
1023
 
1029
1024
 
1030
1025
  Parameters
1031
1026
  ----------
1032
- event : Union[str, Dict[str, Any]], optional, default None
1033
- Event dependency for this flow.
1034
- events : List[Union[str, Dict[str, Any]]], default []
1035
- Events dependency for this flow.
1036
- options : Dict[str, Any], default {}
1037
- Backend-specific configuration for tuning eventing behavior.
1027
+ hourly : bool, default False
1028
+ Run the workflow hourly.
1029
+ daily : bool, default True
1030
+ Run the workflow daily.
1031
+ weekly : bool, default False
1032
+ Run the workflow weekly.
1033
+ cron : str, optional, default None
1034
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1035
+ specified by this expression.
1036
+ timezone : str, optional, default None
1037
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1038
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1038
1039
  """
1039
1040
  ...
1040
1041
 
@@ -1174,6 +1175,99 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
1174
1175
  """
1175
1176
  ...
1176
1177
 
1178
+ @typing.overload
1179
+ 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]]:
1180
+ """
1181
+ Specifies the event(s) that this flow depends on.
1182
+
1183
+ ```
1184
+ @trigger(event='foo')
1185
+ ```
1186
+ or
1187
+ ```
1188
+ @trigger(events=['foo', 'bar'])
1189
+ ```
1190
+
1191
+ Additionally, you can specify the parameter mappings
1192
+ to map event payload to Metaflow parameters for the flow.
1193
+ ```
1194
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1195
+ ```
1196
+ or
1197
+ ```
1198
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1199
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1200
+ ```
1201
+
1202
+ 'parameters' can also be a list of strings and tuples like so:
1203
+ ```
1204
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1205
+ ```
1206
+ This is equivalent to:
1207
+ ```
1208
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1209
+ ```
1210
+
1211
+
1212
+ Parameters
1213
+ ----------
1214
+ event : Union[str, Dict[str, Any]], optional, default None
1215
+ Event dependency for this flow.
1216
+ events : List[Union[str, Dict[str, Any]]], default []
1217
+ Events dependency for this flow.
1218
+ options : Dict[str, Any], default {}
1219
+ Backend-specific configuration for tuning eventing behavior.
1220
+ """
1221
+ ...
1222
+
1223
+ @typing.overload
1224
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1225
+ ...
1226
+
1227
+ 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] = {}):
1228
+ """
1229
+ Specifies the event(s) that this flow depends on.
1230
+
1231
+ ```
1232
+ @trigger(event='foo')
1233
+ ```
1234
+ or
1235
+ ```
1236
+ @trigger(events=['foo', 'bar'])
1237
+ ```
1238
+
1239
+ Additionally, you can specify the parameter mappings
1240
+ to map event payload to Metaflow parameters for the flow.
1241
+ ```
1242
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1243
+ ```
1244
+ or
1245
+ ```
1246
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1247
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1248
+ ```
1249
+
1250
+ 'parameters' can also be a list of strings and tuples like so:
1251
+ ```
1252
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1253
+ ```
1254
+ This is equivalent to:
1255
+ ```
1256
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1257
+ ```
1258
+
1259
+
1260
+ Parameters
1261
+ ----------
1262
+ event : Union[str, Dict[str, Any]], optional, default None
1263
+ Event dependency for this flow.
1264
+ events : List[Union[str, Dict[str, Any]]], default []
1265
+ Events dependency for this flow.
1266
+ options : Dict[str, Any], default {}
1267
+ Backend-specific configuration for tuning eventing behavior.
1268
+ """
1269
+ ...
1270
+
1177
1271
  @typing.overload
1178
1272
  def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1179
1273
  """
@@ -1225,97 +1319,3 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1225
1319
  """
1226
1320
  ...
1227
1321
 
1228
- 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]]:
1229
- """
1230
- 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)
1231
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1232
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1233
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1234
- starts only after all sensors finish.
1235
-
1236
-
1237
- Parameters
1238
- ----------
1239
- timeout : int
1240
- Time, in seconds before the task times out and fails. (Default: 3600)
1241
- poke_interval : int
1242
- Time in seconds that the job should wait in between each try. (Default: 60)
1243
- mode : str
1244
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1245
- exponential_backoff : bool
1246
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1247
- pool : str
1248
- the slot pool this task should run in,
1249
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1250
- soft_fail : bool
1251
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1252
- name : str
1253
- Name of the sensor on Airflow
1254
- description : str
1255
- Description of sensor in the Airflow UI
1256
- bucket_key : Union[str, List[str]]
1257
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1258
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1259
- bucket_name : str
1260
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1261
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1262
- wildcard_match : bool
1263
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1264
- aws_conn_id : str
1265
- a reference to the s3 connection on Airflow. (Default: None)
1266
- verify : bool
1267
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1268
- """
1269
- ...
1270
-
1271
- @typing.overload
1272
- def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1273
- """
1274
- Specifies the times when the flow should be run when running on a
1275
- production scheduler.
1276
-
1277
-
1278
- Parameters
1279
- ----------
1280
- hourly : bool, default False
1281
- Run the workflow hourly.
1282
- daily : bool, default True
1283
- Run the workflow daily.
1284
- weekly : bool, default False
1285
- Run the workflow weekly.
1286
- cron : str, optional, default None
1287
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1288
- specified by this expression.
1289
- timezone : str, optional, default None
1290
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1291
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1292
- """
1293
- ...
1294
-
1295
- @typing.overload
1296
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1297
- ...
1298
-
1299
- def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1300
- """
1301
- Specifies the times when the flow should be run when running on a
1302
- production scheduler.
1303
-
1304
-
1305
- Parameters
1306
- ----------
1307
- hourly : bool, default False
1308
- Run the workflow hourly.
1309
- daily : bool, default True
1310
- Run the workflow daily.
1311
- weekly : bool, default False
1312
- Run the workflow weekly.
1313
- cron : str, optional, default None
1314
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1315
- specified by this expression.
1316
- timezone : str, optional, default None
1317
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1318
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1319
- """
1320
- ...
1321
-