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,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.699335 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.065252 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -11,6 +11,9 @@ if typing.TYPE_CHECKING:
11
11
  import metaflow.decorators
12
12
 
13
13
  class MetaDatum(tuple, metaclass=type):
14
+ """
15
+ MetaDatum(field, value, type, tags)
16
+ """
14
17
  @staticmethod
15
18
  def __new__(_cls, field, value, type, tags):
16
19
  """
@@ -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.704019 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.070289 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -9,7 +9,6 @@ from __future__ import annotations
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
11
  import metaflow.runner.deployer
12
- import metaflow.runner.subprocess_manager
13
12
 
14
13
  class StepFunctions(object, metaclass=type):
15
14
  def __init__(self, name, graph, flow, code_package_sha, code_package_url, production_token, metadata, flow_datastore, environment, event_logger, monitor, tags = None, namespace = None, username = None, max_workers = None, workflow_timeout = None, is_project = False, use_distributed_map = False):
@@ -43,6 +42,30 @@ class StepFunctions(object, metaclass=type):
43
42
  ...
44
43
 
45
44
  class DeployerImpl(object, metaclass=type):
45
+ """
46
+ Base class for deployer implementations. Each implementation should define a TYPE
47
+ class variable that matches the name of the CLI group.
48
+
49
+ Parameters
50
+ ----------
51
+ flow_file : str
52
+ Path to the flow file to deploy.
53
+ show_output : bool, default True
54
+ Show the 'stdout' and 'stderr' to the console by default.
55
+ profile : Optional[str], default None
56
+ Metaflow profile to use for the deployment. If not specified, the default
57
+ profile is used.
58
+ env : Optional[Dict], default None
59
+ Additional environment variables to set for the deployment.
60
+ cwd : Optional[str], default None
61
+ The directory to run the subprocess in; if not specified, the current
62
+ directory is used.
63
+ file_read_timeout : int, default 3600
64
+ The timeout until which we try to read the deployer attribute file.
65
+ **kwargs : Any
66
+ Additional arguments that you would pass to `python myflow.py` before
67
+ the deployment command.
68
+ """
46
69
  def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
47
70
  ...
48
71
  def __enter__(self) -> metaflow.runner.deployer.DeployerImpl:
@@ -81,11 +104,25 @@ class DeployerImpl(object, metaclass=type):
81
104
  ...
82
105
 
83
106
  class DeployedFlow(object, metaclass=type):
107
+ """
108
+ DeployedFlow class represents a flow that has been deployed.
109
+
110
+ Parameters
111
+ ----------
112
+ deployer : DeployerImpl
113
+ Instance of the deployer implementation.
114
+ """
84
115
  def __init__(self, deployer: metaflow.runner.deployer.DeployerImpl):
85
116
  ...
86
117
  ...
87
118
 
88
119
  class TriggeredRun(object, metaclass=type):
120
+ """
121
+ TriggeredRun class represents a run that has been triggered on a production orchestrator.
122
+
123
+ Only when the `start` task starts running, the `run` object corresponding to the run
124
+ becomes available.
125
+ """
89
126
  def __init__(self, deployer: metaflow.runner.deployer.DeployerImpl, content: str):
90
127
  ...
91
128
  def wait_for_run(self, timeout = None):
@@ -146,7 +183,7 @@ def get_lower_level_group(api, top_level_kwargs: typing.Dict, _type: typing.Opti
146
183
  """
147
184
  ...
148
185
 
149
- def handle_timeout(tfp_runner_attribute, command_obj: metaflow.runner.subprocess_manager.CommandManager, file_read_timeout: int):
186
+ def handle_timeout(tfp_runner_attribute, command_obj: "CommandManager", file_read_timeout: int):
150
187
  """
151
188
  Handle the timeout for a running subprocess command that reads a file
152
189
  and raises an error with appropriate logs if a TimeoutError occurs.
@@ -261,6 +298,14 @@ def trigger(instance: metaflow.runner.deployer.DeployedFlow, **kwargs):
261
298
  ...
262
299
 
263
300
  class StepFunctionsDeployer(metaflow.runner.deployer.DeployerImpl, metaclass=type):
301
+ """
302
+ Deployer implementation for AWS Step Functions.
303
+
304
+ Attributes
305
+ ----------
306
+ TYPE : ClassVar[Optional[str]]
307
+ The type of the deployer, which is "step-functions".
308
+ """
264
309
  def __init__(self, deployer_kwargs, **kwargs):
265
310
  """
266
311
  Initialize the StepFunctionsDeployer.
@@ -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.636694 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:39.998720 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -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.696129 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.061985 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -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.696374 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.062278 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -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.697918 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.063744 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -9,8 +9,8 @@ from __future__ import annotations
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
11
  import abc
12
- import metaflow.plugins.secrets
13
12
  import metaflow.exception
13
+ import metaflow.plugins.secrets
14
14
 
15
15
  class SecretsProvider(abc.ABC, metaclass=abc.ABCMeta):
16
16
  def get_secret_as_dict(self, secret_id, options = {}, role = None) -> typing.Dict[str, str]:
@@ -34,21 +34,39 @@ def create_cacheable_azure_credential():
34
34
  ...
35
35
 
36
36
  class MetaflowAzureKeyVaultBadVault(metaflow.exception.MetaflowException, metaclass=type):
37
+ """
38
+ Raised when the secretid is fully qualified but does not have the right key vault domain
39
+ """
37
40
  ...
38
41
 
39
42
  class MetaflowAzureKeyVaultBadSecretType(metaflow.exception.MetaflowException, metaclass=type):
43
+ """
44
+ Raised when the secret type is anything except secrets
45
+ """
40
46
  ...
41
47
 
42
48
  class MetaflowAzureKeyVaultBadSecretPath(metaflow.exception.MetaflowException, metaclass=type):
49
+ """
50
+ Raised when the secret path does not match to expected length
51
+ """
43
52
  ...
44
53
 
45
54
  class MetaflowAzureKeyVaultBadSecretName(metaflow.exception.MetaflowException, metaclass=type):
55
+ """
56
+ Raised when the secret name does not match expected pattern
57
+ """
46
58
  ...
47
59
 
48
60
  class MetaflowAzureKeyVaultBadSecretVersion(metaflow.exception.MetaflowException, metaclass=type):
61
+ """
62
+ Raised when the secret version does not match expected pattern
63
+ """
49
64
  ...
50
65
 
51
66
  class MetaflowAzureKeyVaultBadSecret(metaflow.exception.MetaflowException, metaclass=type):
67
+ """
68
+ Raised when the secret does not match supported patterns in Metaflow
69
+ """
52
70
  ...
53
71
 
54
72
  class AzureKeyVaultSecretsProvider(metaflow.plugins.secrets.SecretsProvider, metaclass=abc.ABCMeta):
@@ -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.696878 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.062765 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -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.697283 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.063202 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -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.627153 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:39.989833 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -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.634305 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:39.996839 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -1,20 +1,69 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.22 #
4
- # Generated on 2024-09-20T00:45:49.685986 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.059229 #
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.client.core
12
11
  import metaflow.exception
13
- import typing
14
12
  import datetime
15
13
  import metaflow.parameters
14
+ import metaflow.client.core
15
+ import typing
16
16
 
17
17
  class Task(metaflow.client.core.MetaflowObject, metaclass=type):
18
+ """
19
+ A `Task` represents an execution of a `Step`.
20
+
21
+ It contains all `DataArtifact` objects produced by the task as
22
+ well as metadata related to execution.
23
+
24
+ Note that the `@retry` decorator may cause multiple attempts of
25
+ the task to be present. Usually you want the latest attempt, which
26
+ is what instantiating a `Task` object returns by default. If
27
+ you need to e.g. retrieve logs from a failed attempt, you can
28
+ explicitly get information about a specific attempt by using the
29
+ following syntax when creating a task:
30
+
31
+ `Task('flow/run/step/task', attempt=<attempt>)`
32
+
33
+ where `attempt=0` corresponds to the first attempt etc.
34
+
35
+ Attributes
36
+ ----------
37
+ metadata : List[Metadata]
38
+ List of all metadata events associated with the task.
39
+ metadata_dict : Dict[str, str]
40
+ A condensed version of `metadata`: A dictionary where keys
41
+ are names of metadata events and values the latest corresponding event.
42
+ data : MetaflowData
43
+ Container of all data artifacts produced by this task. Note that this
44
+ call downloads all data locally, so it can be slower than accessing
45
+ artifacts individually. See `MetaflowData` for more information.
46
+ artifacts : MetaflowArtifacts
47
+ Container of `DataArtifact` objects produced by this task.
48
+ successful : bool
49
+ True if the task completed successfully.
50
+ finished : bool
51
+ True if the task completed.
52
+ exception : object
53
+ Exception raised by this task if there was one.
54
+ finished_at : datetime
55
+ Time this task finished.
56
+ runtime_name : str
57
+ Runtime this task was executed on.
58
+ stdout : str
59
+ Standard output for the task execution.
60
+ stderr : str
61
+ Standard error output for the task execution.
62
+ code : MetaflowCode
63
+ Code package for this task (if present). See `MetaflowCode`.
64
+ environment_info : Dict[str, str]
65
+ Information about the execution environment.
66
+ """
18
67
  def __init__(self, *args, **kwargs):
19
68
  ...
20
69
  @property
@@ -409,6 +458,9 @@ class CardDatastore(object, metaclass=type):
409
458
  NUM_SHORT_HASH_CHARS: int
410
459
 
411
460
  class CardClassFoundException(metaflow.exception.MetaflowException, metaclass=type):
461
+ """
462
+ This exception is raised with MetaflowCard class is not present for a particular card type.
463
+ """
412
464
  def __init__(self, card_name):
413
465
  ...
414
466
  ...
@@ -424,6 +476,9 @@ class UnrenderableCardException(metaflow.exception.MetaflowException, metaclass=
424
476
  ...
425
477
 
426
478
  class CardNotPresentException(metaflow.exception.MetaflowException, metaclass=type):
479
+ """
480
+ This exception is raised with a card is not present in the datastore.
481
+ """
427
482
  def __init__(self, pathspec, card_type = None, card_hash = None, card_id = None):
428
483
  ...
429
484
  ...
@@ -440,6 +495,9 @@ def resumed_info(task):
440
495
  ...
441
496
 
442
497
  class CardRenderInfo(tuple, metaclass=type):
498
+ """
499
+ CardRenderInfo(mode, is_implemented, data, timed_out, timeout_stack_trace)
500
+ """
443
501
  @staticmethod
444
502
  def __new__(_cls, mode, is_implemented, data, timed_out, timeout_stack_trace):
445
503
  """
@@ -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.645393 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.007523 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -86,6 +86,14 @@ class IncorrectPathspecException(metaflow.exception.MetaflowException, metaclass
86
86
  ...
87
87
 
88
88
  class Card(object, metaclass=type):
89
+ """
90
+ `Card` represents an individual Metaflow Card, a single HTML file, produced by
91
+ the card `@card` decorator. `Card`s are contained by `CardContainer`, returned by
92
+ `get_cards`.
93
+
94
+ Note that the contents of the card, an HTML file, is retrieved lazily when you call
95
+ `Card.get` for the first time or when the card is rendered in a notebook.
96
+ """
89
97
  def __init__(self, card_ds, type, path, hash, id = None, html = None, created_on = None, from_resumed = False, origin_pathspec = None):
90
98
  ...
91
99
  def get_data(self) -> typing.Optional[dict]:
@@ -137,6 +145,29 @@ class Card(object, metaclass=type):
137
145
  ...
138
146
 
139
147
  class CardContainer(object, metaclass=type):
148
+ """
149
+ `CardContainer` is an immutable list-like object, returned by `get_cards`,
150
+ which contains individual `Card`s.
151
+
152
+ Notably, `CardContainer` contains a special
153
+ `_repr_html_` function which renders cards automatically in an output
154
+ cell of a notebook.
155
+
156
+ The following operations are supported:
157
+ ```
158
+ cards = get_cards(MyTask)
159
+
160
+ # retrieve by index
161
+ first_card = cards[0]
162
+
163
+ # check length
164
+ if len(cards) > 1:
165
+ print('many cards present!')
166
+
167
+ # iteration
168
+ list_of_cards = list(cards)
169
+ ```
170
+ """
140
171
  def __init__(self, card_paths, card_ds, origin_pathspec = None):
141
172
  ...
142
173
  def __len__(self):
@@ -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.680915 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.053733 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -15,6 +15,9 @@ current: metaflow.metaflow_current.Current
15
15
  ASYNC_TIMEOUT: int
16
16
 
17
17
  class CardProcessManager(object, metaclass=type):
18
+ """
19
+ This class is responsible for managing the card creation processes.
20
+ """
18
21
  ...
19
22
 
20
23
  class CardCreator(object, metaclass=type):
@@ -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.682719 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.055668 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -25,6 +25,9 @@ CARD_GSROOT: None
25
25
  SKIP_CARD_DUALWRITE: bool
26
26
 
27
27
  class CardNotPresentException(metaflow.exception.MetaflowException, metaclass=type):
28
+ """
29
+ This exception is raised with a card is not present in the datastore.
30
+ """
28
31
  def __init__(self, pathspec, card_type = None, card_hash = None, card_id = None):
29
32
  ...
30
33
  ...
@@ -34,6 +37,9 @@ TEMP_DIR_NAME: str
34
37
  NUM_SHORT_HASH_CHARS: int
35
38
 
36
39
  class CardInfo(tuple, metaclass=type):
40
+ """
41
+ CardInfo(type, hash, id, filename)
42
+ """
37
43
  @staticmethod
38
44
  def __new__(_cls, type, hash, id, filename):
39
45
  """
@@ -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.681792 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.054693 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -14,6 +14,25 @@ if typing.TYPE_CHECKING:
14
14
  current: metaflow.metaflow_current.Current
15
15
 
16
16
  class CardComponentCollector(object, metaclass=type):
17
+ """
18
+ This class helps collect `MetaflowCardComponent`s during runtime execution
19
+
20
+ ### Usage with `current`
21
+ `current.card` is of type `CardComponentCollector`
22
+
23
+ ### Main Usage TLDR
24
+ - [x] `current.card.append` customizes the default editable card.
25
+ - [x] Only one card can be default editable in a step.
26
+ - [x] The card class must have `ALLOW_USER_COMPONENTS=True` to be considered default editable.
27
+ - [x] Classes with `ALLOW_USER_COMPONENTS=False` are never default editable.
28
+ - [x] The user can specify an `id` argument to a card, in which case the card is editable through `current.card[id].append`.
29
+ - [x] A card with an id can be also default editable, if there are no other cards that are eligible to be default editable.
30
+ - [x] If multiple default-editable cards exist but only one card doesn't have an id, the card without an id is considered to be default editable.
31
+ - [x] If we can't resolve a single default editable card through the above rules, `current.card`.append calls show a warning but the call doesn't fail.
32
+ - [x] A card that is not default editable can be still edited through:
33
+ - [x] its `current.card['myid']`
34
+ - [x] by looking it up by its type, e.g. `current.card.get(type='pytorch')`.
35
+ """
17
36
  def __init__(self, logger = None, card_creator = None):
18
37
  ...
19
38
  @staticmethod
@@ -121,6 +140,37 @@ def warning_message(message, logger = None, ts = False):
121
140
  ...
122
141
 
123
142
  class CardDecorator(metaflow.decorators.StepDecorator, metaclass=type):
143
+ """
144
+ Creates a human-readable report, a Metaflow Card, after this step completes.
145
+
146
+ Note that you may add multiple `@card` decorators in a step with different parameters.
147
+
148
+ Parameters
149
+ ----------
150
+ type : str, default 'default'
151
+ Card type.
152
+ id : str, optional, default None
153
+ If multiple cards are present, use this id to identify this card.
154
+ options : Dict[str, Any], default {}
155
+ Options passed to the card. The contents depend on the card type.
156
+ timeout : int, default 45
157
+ Interrupt reporting if it takes more than this many seconds.
158
+
159
+ MF Add To Current
160
+ -----------------
161
+ card -> metaflow.plugins.cards.component_serializer.CardComponentCollector
162
+ The `@card` decorator makes the cards available through the `current.card`
163
+ object. If multiple `@card` decorators are present, you can add an `ID` to
164
+ distinguish between them using `@card(id=ID)` as the decorator. You will then
165
+ be able to access that specific card using `current.card[ID].
166
+
167
+ Methods available are `append` and `extend`
168
+
169
+ @@ Returns
170
+ -------
171
+ CardComponentCollector
172
+ The or one of the cards attached to this step.
173
+ """
124
174
  def __init__(self, *args, **kwargs):
125
175
  ...
126
176
  def step_init(self, flow, graph, step_name, decorators, environment, flow_datastore, logger):
@@ -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.678192 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.050925 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -11,6 +11,32 @@ if typing.TYPE_CHECKING:
11
11
  import metaflow
12
12
 
13
13
  class MetaflowCard(object, metaclass=type):
14
+ """
15
+ Metaflow cards derive from this base class.
16
+
17
+ Subclasses of this class are called *card types*. The desired card
18
+ type `T` is defined in the `@card` decorator as `@card(type=T)`.
19
+
20
+ After a task with `@card(type=T, options=S)` finishes executing, Metaflow instantiates
21
+ a subclass `C` of `MetaflowCard` that has its `type` attribute set to `T`, i.e. `C.type=T`.
22
+ The constructor is given the options dictionary `S` that contains arbitrary
23
+ JSON-encodable data that is passed to the instance, parametrizing the card. The subclass
24
+ may override the constructor to capture and process the options.
25
+
26
+ The subclass needs to implement a `render(task)` method that produces the card
27
+ contents in HTML, given the finished task that is represented by a `Task` object.
28
+
29
+ Attributes
30
+ ----------
31
+ type : str
32
+ Card type string. Note that this should be a globally unique name, similar to a
33
+ Python package name, to avoid name clashes between different custom cards.
34
+
35
+ Parameters
36
+ ----------
37
+ options : Dict
38
+ JSON-encodable dictionary containing user-definable options for the class.
39
+ """
14
40
  def __init__(self, options = {}, components = [], graph = None):
15
41
  ...
16
42
  def render(self, task: "metaflow.Task") -> str:
@@ -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.639721 #
3
+ # MF version: 2.12.23 #
4
+ # Generated on 2024-10-01T14:32:40.001932 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -13,6 +13,32 @@ if typing.TYPE_CHECKING:
13
13
  import metaflow
14
14
 
15
15
  class MetaflowCard(object, metaclass=type):
16
+ """
17
+ Metaflow cards derive from this base class.
18
+
19
+ Subclasses of this class are called *card types*. The desired card
20
+ type `T` is defined in the `@card` decorator as `@card(type=T)`.
21
+
22
+ After a task with `@card(type=T, options=S)` finishes executing, Metaflow instantiates
23
+ a subclass `C` of `MetaflowCard` that has its `type` attribute set to `T`, i.e. `C.type=T`.
24
+ The constructor is given the options dictionary `S` that contains arbitrary
25
+ JSON-encodable data that is passed to the instance, parametrizing the card. The subclass
26
+ may override the constructor to capture and process the options.
27
+
28
+ The subclass needs to implement a `render(task)` method that produces the card
29
+ contents in HTML, given the finished task that is represented by a `Task` object.
30
+
31
+ Attributes
32
+ ----------
33
+ type : str
34
+ Card type string. Note that this should be a globally unique name, similar to a
35
+ Python package name, to avoid name clashes between different custom cards.
36
+
37
+ Parameters
38
+ ----------
39
+ options : Dict
40
+ JSON-encodable dictionary containing user-definable options for the class.
41
+ """
16
42
  def __init__(self, options = {}, components = [], graph = None):
17
43
  ...
18
44
  def render(self, task: "metaflow.Task") -> str:
@@ -88,6 +114,14 @@ def read_file(path):
88
114
  ...
89
115
 
90
116
  class DefaultComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
117
+ """
118
+ The `DefaultCard` and the `BlankCard` use a JS framework that build the HTML dynamically from JSON.
119
+ The `DefaultComponent` is the base component that helps build the JSON when `render` is called.
120
+
121
+ The underlying JS framework consists of various types of objects.
122
+ These can be found in: "metaflow/plugins/cards/ui/types.ts".
123
+ The `type` attribute in a `DefaultComponent` corresponds to the type of component in the Javascript framework.
124
+ """
91
125
  def __init__(self, title = None, subtitle = None):
92
126
  ...
93
127
  def render(self):
@@ -197,6 +231,11 @@ class MarkdownComponent(DefaultComponent, metaclass=type):
197
231
  ...
198
232
 
199
233
  class TaskInfoComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
234
+ """
235
+ Properties
236
+ page_content : a list of MetaflowCardComponents going as task info
237
+ final_component: the dictionary returned by the `render` function of this class.
238
+ """
200
239
  def __init__(self, task, page_title = "Task Info", only_repr = True, graph = None, components = [], runtime = False):
201
240
  ...
202
241
  def render(self):