metaflow-stubs 2.12.22__py2.py3-none-any.whl → 2.12.23__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 (152) hide show
  1. metaflow-stubs/__init__.pyi +1029 -638
  2. metaflow-stubs/cards.pyi +211 -5
  3. metaflow-stubs/cli.pyi +23 -3
  4. metaflow-stubs/client/__init__.pyi +128 -3
  5. metaflow-stubs/client/core.pyi +227 -7
  6. metaflow-stubs/client/filecache.pyi +3 -3
  7. metaflow-stubs/clone_util.pyi +5 -2
  8. metaflow-stubs/events.pyi +20 -2
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +71 -5
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +158 -5
  13. metaflow-stubs/info_file.pyi +2 -2
  14. metaflow-stubs/metadata/metadata.pyi +9 -3
  15. metaflow-stubs/metadata/util.pyi +2 -2
  16. metaflow-stubs/metaflow_config.pyi +2 -2
  17. metaflow-stubs/metaflow_current.pyi +26 -23
  18. metaflow-stubs/mflog/mflog.pyi +2 -2
  19. metaflow-stubs/multicore_utils.pyi +2 -2
  20. metaflow-stubs/parameters.pyi +69 -3
  21. metaflow-stubs/plugins/__init__.pyi +14 -3
  22. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  23. metaflow-stubs/plugins/airflow/airflow.pyi +15 -3
  24. metaflow-stubs/plugins/airflow/airflow_cli.pyi +66 -3
  25. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +5 -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 +80 -2
  29. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +5 -2
  30. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +44 -2
  31. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +44 -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 +16 -2
  35. metaflow-stubs/plugins/argo/argo_workflows.pyi +6 -4
  36. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +97 -6
  37. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +34 -6
  38. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +49 -4
  39. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  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_cli.pyi +2 -2
  45. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  46. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +103 -3
  47. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +15 -3
  49. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +21 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +69 -3
  56. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +5 -2
  58. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +49 -4
  59. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  61. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  62. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +21 -3
  63. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  64. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  65. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  66. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_cli.pyi +62 -4
  68. metaflow-stubs/plugins/cards/card_client.pyi +33 -2
  69. metaflow-stubs/plugins/cards/card_creator.pyi +5 -2
  70. metaflow-stubs/plugins/cards/card_datastore.pyi +8 -2
  71. metaflow-stubs/plugins/cards/card_decorator.pyi +52 -2
  72. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +28 -2
  73. metaflow-stubs/plugins/cards/card_modules/basic.pyi +41 -2
  74. metaflow-stubs/plugins/cards/card_modules/card.pyi +28 -2
  75. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/components.pyi +184 -4
  81. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +5 -2
  82. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  83. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +35 -2
  84. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  85. metaflow-stubs/plugins/cards/component_serializer.pyi +57 -4
  86. metaflow-stubs/plugins/cards/exception.pyi +8 -2
  87. metaflow-stubs/plugins/catch_decorator.pyi +20 -3
  88. metaflow-stubs/plugins/datatools/__init__.pyi +62 -2
  89. metaflow-stubs/plugins/datatools/local.pyi +16 -2
  90. metaflow-stubs/plugins/datatools/s3/__init__.pyi +72 -3
  91. metaflow-stubs/plugins/datatools/s3/s3.pyi +82 -5
  92. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  93. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  94. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  95. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  96. metaflow-stubs/plugins/environment_decorator.pyi +10 -2
  97. metaflow-stubs/plugins/events_decorator.pyi +106 -2
  98. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/frameworks/pytorch.pyi +24 -3
  100. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +15 -3
  102. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  103. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  104. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  105. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  106. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  107. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  108. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
  109. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +65 -2
  110. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +100 -3
  112. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  113. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +5 -2
  114. metaflow-stubs/plugins/logs_cli.pyi +2 -2
  115. metaflow-stubs/plugins/package_cli.pyi +2 -2
  116. metaflow-stubs/plugins/parallel_decorator.pyi +29 -2
  117. metaflow-stubs/plugins/project_decorator.pyi +59 -2
  118. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  119. metaflow-stubs/plugins/pypi/conda_decorator.pyi +45 -2
  120. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  121. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +33 -2
  122. metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
  123. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  124. metaflow-stubs/plugins/resources_decorator.pyi +33 -2
  125. metaflow-stubs/plugins/retry_decorator.pyi +21 -2
  126. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  127. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  128. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +11 -2
  129. metaflow-stubs/plugins/storage_executor.pyi +6 -2
  130. metaflow-stubs/plugins/tag_cli.pyi +35 -4
  131. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +10 -3
  132. metaflow-stubs/plugins/timeout_decorator.pyi +23 -2
  133. metaflow-stubs/procpoll.pyi +2 -2
  134. metaflow-stubs/pylint_wrapper.pyi +2 -2
  135. metaflow-stubs/runner/__init__.pyi +2 -2
  136. metaflow-stubs/runner/deployer.pyi +70 -131
  137. metaflow-stubs/runner/metaflow_runner.pyi +117 -9
  138. metaflow-stubs/runner/nbdeploy.pyi +66 -2
  139. metaflow-stubs/runner/nbrun.pyi +79 -2
  140. metaflow-stubs/runner/subprocess_manager.pyi +16 -4
  141. metaflow-stubs/runner/utils.pyi +32 -2
  142. metaflow-stubs/system/__init__.pyi +4 -4
  143. metaflow-stubs/system/system_logger.pyi +3 -3
  144. metaflow-stubs/system/system_monitor.pyi +3 -3
  145. metaflow-stubs/tagging_util.pyi +2 -2
  146. metaflow-stubs/tuple_util.pyi +2 -2
  147. metaflow-stubs/version.pyi +2 -2
  148. {metaflow_stubs-2.12.22.dist-info → metaflow_stubs-2.12.23.dist-info}/METADATA +2 -2
  149. metaflow_stubs-2.12.23.dist-info/RECORD +152 -0
  150. metaflow_stubs-2.12.22.dist-info/RECORD +0 -152
  151. {metaflow_stubs-2.12.22.dist-info → metaflow_stubs-2.12.23.dist-info}/WHEEL +0 -0
  152. {metaflow_stubs-2.12.22.dist-info → metaflow_stubs-2.12.23.dist-info}/top_level.txt +0 -0
@@ -1,25 +1,28 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.22 #
4
- # Generated on 2024-09-20T00:45:49.597112 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:39.957135 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import metaflow.events
12
- import metaflow.client.core
13
11
  import metaflow.exception
14
- import metaflow.metaflow_current
15
- import metaflow
16
- import typing
12
+ import metaflow.events
17
13
  import tarfile
18
14
  import datetime
15
+ import metaflow
16
+ import metaflow.metaflow_current
17
+ import metaflow.client.core
18
+ import typing
19
19
 
20
20
  current: metaflow.metaflow_current.Current
21
21
 
22
22
  class Trigger(object, metaclass=type):
23
+ """
24
+ Defines a container of event triggers' metadata.
25
+ """
23
26
  def __init__(self, _meta = None):
24
27
  ...
25
28
  @classmethod
@@ -174,6 +177,9 @@ class FileCache(object, metaclass=type):
174
177
  ...
175
178
 
176
179
  class Metadata(tuple, metaclass=type):
180
+ """
181
+ Metadata(name, value, created_at, type, task)
182
+ """
177
183
  @staticmethod
178
184
  def __new__(_cls, name, value, created_at, type, task):
179
185
  """
@@ -304,6 +310,45 @@ def default_namespace() -> str:
304
310
  ...
305
311
 
306
312
  class MetaflowObject(object, metaclass=type):
313
+ """
314
+ Base class for all Metaflow objects.
315
+
316
+ Creates a new object of a specific type (Flow, Run, Step, Task, DataArtifact) given
317
+ a path to it (its `pathspec`).
318
+
319
+ Accessing Metaflow objects is done through one of two methods:
320
+ - either by directly instantiating it with this class
321
+ - or by accessing it through its parent (iterating over
322
+ all children or accessing directly using the [] operator)
323
+
324
+ With this class, you can:
325
+ - Get a `Flow`; use `Flow('FlowName')`.
326
+ - Get a `Run` of a flow; use `Run('FlowName/RunID')`.
327
+ - Get a `Step` of a run; use `Step('FlowName/RunID/StepName')`.
328
+ - Get a `Task` of a step, use `Task('FlowName/RunID/StepName/TaskID')`
329
+ - Get a `DataArtifact` of a task; use
330
+ `DataArtifact('FlowName/RunID/StepName/TaskID/ArtifactName')`.
331
+
332
+ Attributes
333
+ ----------
334
+ tags : FrozenSet[str]
335
+ Tags associated with the run this object belongs to (user and system tags).
336
+ user_tags: FrozenSet[str]
337
+ User tags associated with the run this object belongs to.
338
+ system_tags: FrozenSet[str]
339
+ System tags associated with the run this object belongs to.
340
+ created_at : datetime
341
+ Date and time this object was first created.
342
+ parent : MetaflowObject
343
+ Parent of this object. The parent of a `Run` is a `Flow` for example
344
+ pathspec : str
345
+ Pathspec of this object (for example: 'FlowName/RunID' for a `Run`)
346
+ path_components : List[str]
347
+ Components of the pathspec
348
+ origin_pathspec : str, optional
349
+ Pathspec of the original object this object was cloned from (in the case of a resume).
350
+ None if not applicable.
351
+ """
307
352
  def __init__(self, pathspec: typing.Optional[str] = None, attempt: typing.Optional[int] = None, _object: typing.Optional["MetaflowObject"] = None, _parent: typing.Optional["MetaflowObject"] = None, _namespace_check: bool = True, _current_namespace: typing.Optional[str] = None):
308
353
  ...
309
354
  def __iter__(self) -> typing.Iterator["MetaflowObject"]:
@@ -487,6 +532,30 @@ class MetaflowObject(object, metaclass=type):
487
532
  ...
488
533
 
489
534
  class MetaflowCode(object, metaclass=type):
535
+ """
536
+ Snapshot of the code used to execute this `Run`. Instantiate the object through
537
+ `Run(...).code` (if any step is executed remotely) or `Task(...).code` for an
538
+ individual task. The code package is the same for all steps of a `Run`.
539
+
540
+ `MetaflowCode` includes a package of the user-defined `FlowSpec` class and supporting
541
+ files, as well as a snapshot of the Metaflow library itself.
542
+
543
+ Currently, `MetaflowCode` objects are stored only for `Run`s that have at least one `Step`
544
+ executing outside the user's local environment.
545
+
546
+ The `TarFile` for the `Run` is given by `Run(...).code.tarball`
547
+
548
+ Attributes
549
+ ----------
550
+ path : str
551
+ Location (in the datastore provider) of the code package.
552
+ info : Dict[str, str]
553
+ Dictionary of information related to this code-package.
554
+ flowspec : str
555
+ Source code of the file containing the `FlowSpec` in this code package.
556
+ tarball : TarFile
557
+ Python standard library `tarfile.TarFile` archive containing all the code.
558
+ """
490
559
  def __init__(self, flow_name: str, code_package: str):
491
560
  ...
492
561
  @property
@@ -538,6 +607,21 @@ class MetaflowCode(object, metaclass=type):
538
607
  ...
539
608
 
540
609
  class DataArtifact(MetaflowObject, metaclass=type):
610
+ """
611
+ A single data artifact and associated metadata. Note that this object does
612
+ not contain other objects as it is the leaf object in the hierarchy.
613
+
614
+ Attributes
615
+ ----------
616
+ data : object
617
+ The data contained in this artifact, that is, the object produced during
618
+ execution of this run.
619
+ sha : string
620
+ A unique ID of this artifact.
621
+ finished_at : datetime
622
+ Corresponds roughly to the `Task.finished_at` time of the parent `Task`.
623
+ An alias for `DataArtifact.created_at`.
624
+ """
541
625
  @property
542
626
  def data(self) -> typing.Any:
543
627
  """
@@ -594,6 +678,32 @@ class DataArtifact(MetaflowObject, metaclass=type):
594
678
  ...
595
679
 
596
680
  class MetaflowData(object, metaclass=type):
681
+ """
682
+ Container of data artifacts produced by a `Task`. This object is
683
+ instantiated through `Task.data`.
684
+
685
+ `MetaflowData` allows results to be retrieved by their name
686
+ through a convenient dot notation:
687
+
688
+ ```python
689
+ Task(...).data.my_object
690
+ ```
691
+
692
+ You can also test the existence of an object
693
+
694
+ ```python
695
+ if 'my_object' in Task(...).data:
696
+ print('my_object found')
697
+ ```
698
+
699
+ Note that this container relies on the local cache to load all data
700
+ artifacts. If your `Task` contains a lot of data, a more efficient
701
+ approach is to load artifacts individually like so
702
+
703
+ ```
704
+ Task(...)['my_object'].data
705
+ ```
706
+ """
597
707
  def __init__(self, artifacts: typing.Iterable[DataArtifact]):
598
708
  ...
599
709
  def __getattr__(self, name: str):
@@ -607,6 +717,55 @@ class MetaflowData(object, metaclass=type):
607
717
  ...
608
718
 
609
719
  class Task(MetaflowObject, metaclass=type):
720
+ """
721
+ A `Task` represents an execution of a `Step`.
722
+
723
+ It contains all `DataArtifact` objects produced by the task as
724
+ well as metadata related to execution.
725
+
726
+ Note that the `@retry` decorator may cause multiple attempts of
727
+ the task to be present. Usually you want the latest attempt, which
728
+ is what instantiating a `Task` object returns by default. If
729
+ you need to e.g. retrieve logs from a failed attempt, you can
730
+ explicitly get information about a specific attempt by using the
731
+ following syntax when creating a task:
732
+
733
+ `Task('flow/run/step/task', attempt=<attempt>)`
734
+
735
+ where `attempt=0` corresponds to the first attempt etc.
736
+
737
+ Attributes
738
+ ----------
739
+ metadata : List[Metadata]
740
+ List of all metadata events associated with the task.
741
+ metadata_dict : Dict[str, str]
742
+ A condensed version of `metadata`: A dictionary where keys
743
+ are names of metadata events and values the latest corresponding event.
744
+ data : MetaflowData
745
+ Container of all data artifacts produced by this task. Note that this
746
+ call downloads all data locally, so it can be slower than accessing
747
+ artifacts individually. See `MetaflowData` for more information.
748
+ artifacts : MetaflowArtifacts
749
+ Container of `DataArtifact` objects produced by this task.
750
+ successful : bool
751
+ True if the task completed successfully.
752
+ finished : bool
753
+ True if the task completed.
754
+ exception : object
755
+ Exception raised by this task if there was one.
756
+ finished_at : datetime
757
+ Time this task finished.
758
+ runtime_name : str
759
+ Runtime this task was executed on.
760
+ stdout : str
761
+ Standard output for the task execution.
762
+ stderr : str
763
+ Standard error output for the task execution.
764
+ code : MetaflowCode
765
+ Code package for this task (if present). See `MetaflowCode`.
766
+ environment_info : Dict[str, str]
767
+ Information about the execution environment.
768
+ """
610
769
  def __init__(self, *args, **kwargs):
611
770
  ...
612
771
  @property
@@ -921,6 +1080,23 @@ class Task(MetaflowObject, metaclass=type):
921
1080
  ...
922
1081
 
923
1082
  class Step(MetaflowObject, metaclass=type):
1083
+ """
1084
+ A `Step` represents a user-defined step, that is, a method annotated with the `@step` decorator.
1085
+
1086
+ It contains `Task` objects associated with the step, that is, all executions of the
1087
+ `Step`. The step may contain multiple `Task`s in the case of a foreach step.
1088
+
1089
+ Attributes
1090
+ ----------
1091
+ task : Task
1092
+ The first `Task` object in this step. This is a shortcut for retrieving the only
1093
+ task contained in a non-foreach step.
1094
+ finished_at : datetime
1095
+ Time when the latest `Task` of this step finished. Note that in the case of foreaches,
1096
+ this time may change during execution of the step.
1097
+ environment_info : Dict[str, Any]
1098
+ Information about the execution environment.
1099
+ """
924
1100
  @property
925
1101
  def task(self) -> typing.Optional[Task]:
926
1102
  """
@@ -1055,6 +1231,26 @@ class Step(MetaflowObject, metaclass=type):
1055
1231
  ...
1056
1232
 
1057
1233
  class Run(MetaflowObject, metaclass=type):
1234
+ """
1235
+ A `Run` represents an execution of a `Flow`. It is a container of `Step`s.
1236
+
1237
+ Attributes
1238
+ ----------
1239
+ data : MetaflowData
1240
+ a shortcut to run['end'].task.data, i.e. data produced by this run.
1241
+ successful : bool
1242
+ True if the run completed successfully.
1243
+ finished : bool
1244
+ True if the run completed.
1245
+ finished_at : datetime
1246
+ Time this run finished.
1247
+ code : MetaflowCode
1248
+ Code package for this run (if present). See `MetaflowCode`.
1249
+ trigger : MetaflowTrigger
1250
+ Information about event(s) that triggered this run (if present). See `MetaflowTrigger`.
1251
+ end_task : Task
1252
+ `Task` for the end step (if it is present already).
1253
+ """
1058
1254
  def steps(self, *tags: str) -> typing.Iterator[Step]:
1059
1255
  """
1060
1256
  [Legacy function - do not use]
@@ -1287,6 +1483,17 @@ class Run(MetaflowObject, metaclass=type):
1287
1483
  ...
1288
1484
 
1289
1485
  class Flow(MetaflowObject, metaclass=type):
1486
+ """
1487
+ A Flow represents all existing flows with a certain name, in other words,
1488
+ classes derived from `FlowSpec`. A container of `Run` objects.
1489
+
1490
+ Attributes
1491
+ ----------
1492
+ latest_run : Run
1493
+ Latest `Run` (in progress or completed, successfully or not) of this flow.
1494
+ latest_successful_run : Run
1495
+ Latest successfully completed `Run` of this flow.
1496
+ """
1290
1497
  def __init__(self, *args, **kwargs):
1291
1498
  ...
1292
1499
  @property
@@ -1373,6 +1580,19 @@ class Flow(MetaflowObject, metaclass=type):
1373
1580
  ...
1374
1581
 
1375
1582
  class Metaflow(object, metaclass=type):
1583
+ """
1584
+ Entry point to all objects in the Metaflow universe.
1585
+
1586
+ This object can be used to list all the flows present either through the explicit property
1587
+ or by iterating over this object.
1588
+
1589
+ Attributes
1590
+ ----------
1591
+ flows : List[Flow]
1592
+ Returns the list of all `Flow` objects known to this metadata provider. Note that only
1593
+ flows present in the current namespace will be returned. A `Flow` is present in a namespace
1594
+ if it has at least one run in the namespace.
1595
+ """
1376
1596
  def __init__(self):
1377
1597
  ...
1378
1598
  @property
@@ -1,15 +1,15 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.22 #
4
- # Generated on 2024-09-20T00:45:49.625922 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:39.986798 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import metaflow.exception
12
11
  import metaflow.datastore.content_addressed_store
12
+ import metaflow.exception
13
13
 
14
14
  class MetaflowException(Exception, metaclass=type):
15
15
  def __init__(self, msg = "", lineno = None):
@@ -1,13 +1,16 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.22 #
4
- # Generated on 2024-09-20T00:45:49.623378 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:39.984079 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
 
10
10
  class MetaDatum(tuple, metaclass=type):
11
+ """
12
+ MetaDatum(field, value, type, tags)
13
+ """
11
14
  @staticmethod
12
15
  def __new__(_cls, field, value, type, tags):
13
16
  """
metaflow-stubs/events.pyi CHANGED
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.22 #
4
- # Generated on 2024-09-20T00:45:49.599428 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:39.959791 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -14,6 +14,21 @@ if typing.TYPE_CHECKING:
14
14
  TYPE_CHECKING: bool
15
15
 
16
16
  class MetaflowEvent(tuple, metaclass=type):
17
+ """
18
+ Container of metadata that identifies the event that triggered
19
+ the `Run` under consideration.
20
+
21
+ Attributes
22
+ ----------
23
+ name : str
24
+ name of the event.
25
+ id : str
26
+ unique identifier for the event.
27
+ timestamp : datetime
28
+ timestamp recording creation time for the event.
29
+ type : str
30
+ type for the event - one of `event` or `run`
31
+ """
17
32
  @staticmethod
18
33
  def __new__(_cls, name, id, timestamp, type):
19
34
  """
@@ -33,6 +48,9 @@ class MetaflowEvent(tuple, metaclass=type):
33
48
  ...
34
49
 
35
50
  class Trigger(object, metaclass=type):
51
+ """
52
+ Defines a container of event triggers' metadata.
53
+ """
36
54
  def __init__(self, _meta = None):
37
55
  ...
38
56
  @classmethod
@@ -1,7 +1,7 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.22 #
4
- # Generated on 2024-09-20T00:45:49.587431 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:39.947134 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,21 +1,33 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.22 #
4
- # Generated on 2024-09-20T00:45:49.598724 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:39.958875 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import metaflow.flowspec
12
11
  import metaflow.exception
13
- import metaflow.unbounded_foreach
12
+ import metaflow.parameters
14
13
  import metaflow.datastore.inputs
14
+ import metaflow.unbounded_foreach
15
+ import metaflow.flowspec
15
16
  import typing
16
- import metaflow.parameters
17
17
 
18
18
  class DelayedEvaluationParameter(object, metaclass=type):
19
+ """
20
+ This is a very simple wrapper to allow parameter "conversion" to be delayed until
21
+ the `_set_constants` function in FlowSpec. Typically, parameters are converted
22
+ by click when the command line option is processed. For some parameters, like
23
+ IncludeFile, this is too early as it would mean we would trigger the upload
24
+ of the file too early. If a parameter converts to a DelayedEvaluationParameter
25
+ object through the usual click mechanisms, `_set_constants` knows to invoke the
26
+ __call__ method on that DelayedEvaluationParameter; in that case, the __call__
27
+ method is invoked without any parameter. The return_str parameter will be used
28
+ by schedulers when they need to convert DelayedEvaluationParameters to a
29
+ string to store them
30
+ """
19
31
  def __init__(self, name, field, fun):
20
32
  ...
21
33
  def __call__(self, return_str = False):
@@ -23,6 +35,49 @@ class DelayedEvaluationParameter(object, metaclass=type):
23
35
  ...
24
36
 
25
37
  class Parameter(object, metaclass=type):
38
+ """
39
+ Defines a parameter for a flow.
40
+
41
+ Parameters must be instantiated as class variables in flow classes, e.g.
42
+ ```
43
+ class MyFlow(FlowSpec):
44
+ param = Parameter('myparam')
45
+ ```
46
+ in this case, the parameter is specified on the command line as
47
+ ```
48
+ python myflow.py run --myparam=5
49
+ ```
50
+ and its value is accessible through a read-only artifact like this:
51
+ ```
52
+ print(self.param == 5)
53
+ ```
54
+ Note that the user-visible parameter name, `myparam` above, can be
55
+ different from the artifact name, `param` above.
56
+
57
+ The parameter value is converted to a Python type based on the `type`
58
+ argument or to match the type of `default`, if it is set.
59
+
60
+ Parameters
61
+ ----------
62
+ name : str
63
+ User-visible parameter name.
64
+ default : str or float or int or bool or `JSONType` or a function.
65
+ Default value for the parameter. Use a special `JSONType` class to
66
+ indicate that the value must be a valid JSON object. A function
67
+ implies that the parameter corresponds to a *deploy-time parameter*.
68
+ The type of the default value is used as the parameter `type`.
69
+ type : Type, default None
70
+ If `default` is not specified, define the parameter type. Specify
71
+ one of `str`, `float`, `int`, `bool`, or `JSONType`. If None, defaults
72
+ to the type of `default` or `str` if none specified.
73
+ help : str, optional
74
+ Help text to show in `run --help`.
75
+ required : bool, default False
76
+ Require that the user specified a value for the parameter.
77
+ `required=True` implies that the `default` is not used.
78
+ show_default : bool, default True
79
+ If True, show the default value in the help text.
80
+ """
26
81
  def __init__(self, name: str, default: typing.Union[str, float, int, bool, typing.Dict[str, typing.Any], typing.Callable[[], typing.Union[str, float, int, bool, typing.Dict[str, typing.Any]]], None] = None, type: typing.Union[typing.Type[str], typing.Type[float], typing.Type[int], typing.Type[bool], metaflow.parameters.JSONTypeClass, None] = None, help: typing.Optional[str] = None, required: bool = False, show_default: bool = True, **kwargs: typing.Dict[str, typing.Any]):
27
82
  ...
28
83
  def __repr__(self):
@@ -69,6 +124,9 @@ class InvalidNextException(metaflow.exception.MetaflowException, metaclass=type)
69
124
  ...
70
125
 
71
126
  class ParallelUBF(metaflow.unbounded_foreach.UnboundedForeachInput, metaclass=type):
127
+ """
128
+ Unbounded-for-each placeholder for supporting parallel (multi-node) steps.
129
+ """
72
130
  def __init__(self, num_parallel):
73
131
  ...
74
132
  def __getitem__(self, item):
@@ -76,6 +134,14 @@ class ParallelUBF(metaflow.unbounded_foreach.UnboundedForeachInput, metaclass=ty
76
134
  ...
77
135
 
78
136
  class FlowSpec(object, metaclass=_FlowSpecMeta):
137
+ """
138
+ Main class from which all Flows should inherit.
139
+
140
+ Attributes
141
+ ----------
142
+ index
143
+ input
144
+ """
79
145
  def __init__(self, use_cli = True):
80
146
  """
81
147
  Construct a FlowSpec
@@ -1 +1 @@
1
- 2.12.22 2024-09-20T00:45:49.569338
1
+ 2.12.23 2024-10-01T14:32:39.928151