metaflow-stubs 2.12.27__py2.py3-none-any.whl → 2.12.29__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 (159) hide show
  1. metaflow-stubs/__init__.pyi +217 -2921
  2. metaflow-stubs/cards.pyi +19 -473
  3. metaflow-stubs/cli.pyi +17 -81
  4. metaflow-stubs/client/__init__.pyi +19 -1113
  5. metaflow-stubs/client/core.pyi +19 -159
  6. metaflow-stubs/client/filecache.pyi +8 -12
  7. metaflow-stubs/clone_util.pyi +6 -26
  8. metaflow-stubs/events.pyi +7 -6
  9. metaflow-stubs/exception.pyi +8 -6
  10. metaflow-stubs/flowspec.pyi +22 -106
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +16 -564
  13. metaflow-stubs/info_file.pyi +6 -5
  14. metaflow-stubs/metadata_provider/__init__.pyi +16 -0
  15. metaflow-stubs/metadata_provider/heartbeat.pyi +34 -0
  16. metaflow-stubs/{metadata → metadata_provider}/metadata.pyi +10 -22
  17. metaflow-stubs/metadata_provider/util.pyi +19 -0
  18. metaflow-stubs/metaflow_config.pyi +8 -11
  19. metaflow-stubs/metaflow_current.pyi +8 -7
  20. metaflow-stubs/mflog/__init__.pyi +6 -0
  21. metaflow-stubs/mflog/mflog.pyi +52 -5
  22. metaflow-stubs/multicore_utils.pyi +6 -5
  23. metaflow-stubs/parameters.pyi +13 -23
  24. metaflow-stubs/plugins/__init__.pyi +51 -163
  25. metaflow-stubs/plugins/airflow/__init__.pyi +12 -5
  26. metaflow-stubs/plugins/airflow/airflow.pyi +19 -130
  27. metaflow-stubs/plugins/airflow/airflow_cli.pyi +17 -136
  28. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +7 -26
  29. metaflow-stubs/plugins/airflow/airflow_utils.pyi +7 -6
  30. metaflow-stubs/plugins/airflow/exception.pyi +7 -11
  31. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +10 -97
  32. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +9 -30
  33. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +9 -40
  34. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +9 -40
  35. metaflow-stubs/plugins/argo/__init__.pyi +12 -5
  36. metaflow-stubs/plugins/argo/argo_client.pyi +8 -26
  37. metaflow-stubs/plugins/argo/argo_events.pyi +7 -11
  38. metaflow-stubs/plugins/argo/argo_workflows.pyi +17 -121
  39. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +22 -460
  40. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +13 -405
  41. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +65 -322
  42. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +165 -0
  43. metaflow-stubs/plugins/aws/__init__.pyi +11 -5
  44. metaflow-stubs/plugins/aws/aws_client.pyi +6 -5
  45. metaflow-stubs/plugins/aws/aws_utils.pyi +6 -11
  46. metaflow-stubs/plugins/aws/batch/__init__.pyi +10 -5
  47. metaflow-stubs/plugins/aws/batch/batch.pyi +10 -55
  48. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +10 -31
  49. metaflow-stubs/plugins/aws/batch/batch_client.pyi +7 -11
  50. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +15 -140
  51. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +7 -5
  52. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +10 -21
  53. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +15 -5
  54. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +6 -5
  55. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +6 -5
  56. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +6 -5
  57. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +7 -5
  58. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +11 -65
  59. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +19 -175
  60. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +6 -5
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +8 -37
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +53 -290
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +127 -0
  64. metaflow-stubs/plugins/azure/__init__.pyi +12 -7
  65. metaflow-stubs/plugins/azure/azure_credential.pyi +6 -5
  66. metaflow-stubs/plugins/azure/azure_exceptions.pyi +7 -11
  67. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +11 -24
  68. metaflow-stubs/plugins/azure/azure_utils.pyi +11 -29
  69. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +8 -23
  70. metaflow-stubs/plugins/azure/includefile_support.pyi +7 -17
  71. metaflow-stubs/plugins/cards/__init__.pyi +15 -5
  72. metaflow-stubs/plugins/cards/card_cli.pyi +22 -491
  73. metaflow-stubs/plugins/cards/card_client.pyi +14 -76
  74. metaflow-stubs/plugins/cards/card_creator.pyi +7 -10
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +10 -18
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +10 -126
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +14 -81
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +13 -96
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +6 -5
  80. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +12 -73
  81. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +6 -61
  82. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +6 -5
  83. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +8 -45
  84. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +7 -6
  85. metaflow-stubs/plugins/cards/card_modules/components.pyi +24 -107
  86. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +6 -5
  87. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +6 -12
  88. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +11 -88
  89. metaflow-stubs/plugins/cards/card_resolver.pyi +6 -49
  90. metaflow-stubs/plugins/cards/component_serializer.pyi +13 -63
  91. metaflow-stubs/plugins/cards/exception.pyi +7 -11
  92. metaflow-stubs/plugins/catch_decorator.pyi +9 -29
  93. metaflow-stubs/plugins/datatools/__init__.pyi +13 -392
  94. metaflow-stubs/plugins/datatools/local.pyi +7 -11
  95. metaflow-stubs/plugins/datatools/s3/__init__.pyi +19 -653
  96. metaflow-stubs/plugins/datatools/s3/s3.pyi +16 -264
  97. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +7 -10
  98. metaflow-stubs/plugins/datatools/s3/s3util.pyi +6 -11
  99. metaflow-stubs/plugins/debug_logger.pyi +7 -5
  100. metaflow-stubs/plugins/debug_monitor.pyi +7 -5
  101. metaflow-stubs/plugins/environment_decorator.pyi +7 -5
  102. metaflow-stubs/plugins/events_decorator.pyi +8 -14
  103. metaflow-stubs/plugins/frameworks/__init__.pyi +7 -5
  104. metaflow-stubs/plugins/frameworks/pytorch.pyi +8 -45
  105. metaflow-stubs/plugins/gcp/__init__.pyi +11 -7
  106. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +11 -24
  107. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +7 -11
  108. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +6 -5
  109. metaflow-stubs/plugins/gcp/gs_utils.pyi +8 -20
  110. metaflow-stubs/plugins/gcp/includefile_support.pyi +7 -17
  111. metaflow-stubs/plugins/kubernetes/__init__.pyi +13 -5
  112. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +6 -10
  113. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +9 -29
  114. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +16 -155
  115. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +9 -72
  116. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +19 -142
  117. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +8 -41
  118. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +7 -11
  119. metaflow-stubs/plugins/logs_cli.pyi +10 -9
  120. metaflow-stubs/plugins/package_cli.pyi +7 -5
  121. metaflow-stubs/plugins/parallel_decorator.pyi +11 -59
  122. metaflow-stubs/plugins/project_decorator.pyi +8 -14
  123. metaflow-stubs/plugins/pypi/__init__.pyi +12 -11
  124. metaflow-stubs/plugins/pypi/conda_decorator.pyi +8 -27
  125. metaflow-stubs/plugins/pypi/conda_environment.pyi +12 -18
  126. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +7 -5
  127. metaflow-stubs/plugins/pypi/pypi_environment.pyi +7 -39
  128. metaflow-stubs/plugins/pypi/utils.pyi +7 -11
  129. metaflow-stubs/plugins/resources_decorator.pyi +7 -5
  130. metaflow-stubs/plugins/retry_decorator.pyi +7 -11
  131. metaflow-stubs/plugins/secrets/__init__.pyi +9 -5
  132. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +8 -13
  133. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +7 -11
  134. metaflow-stubs/plugins/storage_executor.pyi +6 -11
  135. metaflow-stubs/plugins/tag_cli.pyi +14 -396
  136. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +9 -34
  137. metaflow-stubs/plugins/timeout_decorator.pyi +7 -11
  138. metaflow-stubs/procpoll.pyi +7 -5
  139. metaflow-stubs/pylint_wrapper.pyi +7 -11
  140. metaflow-stubs/runner/__init__.pyi +13 -5
  141. metaflow-stubs/runner/deployer.pyi +102 -210
  142. metaflow-stubs/runner/deployer_impl.pyi +87 -0
  143. metaflow-stubs/runner/metaflow_runner.pyi +24 -508
  144. metaflow-stubs/runner/nbdeploy.pyi +16 -60
  145. metaflow-stubs/runner/nbrun.pyi +11 -148
  146. metaflow-stubs/runner/subprocess_manager.pyi +9 -10
  147. metaflow-stubs/runner/utils.pyi +44 -9
  148. metaflow-stubs/system/__init__.pyi +9 -107
  149. metaflow-stubs/system/system_logger.pyi +6 -15
  150. metaflow-stubs/system/system_monitor.pyi +6 -16
  151. metaflow-stubs/tagging_util.pyi +6 -10
  152. metaflow-stubs/tuple_util.pyi +6 -5
  153. metaflow-stubs/version.pyi +6 -5
  154. {metaflow_stubs-2.12.27.dist-info → metaflow_stubs-2.12.29.dist-info}/METADATA +2 -2
  155. metaflow_stubs-2.12.29.dist-info/RECORD +158 -0
  156. {metaflow_stubs-2.12.27.dist-info → metaflow_stubs-2.12.29.dist-info}/WHEEL +1 -1
  157. metaflow-stubs/metadata/util.pyi +0 -18
  158. metaflow_stubs-2.12.27.dist-info/RECORD +0 -152
  159. {metaflow_stubs-2.12.27.dist-info → metaflow_stubs-2.12.29.dist-info}/top_level.txt +0 -0
@@ -1,52 +1,15 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:18.001290 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.646632 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
 
10
- linesep: str
10
+ from .tokenizer import tokenize as tokenize
11
11
 
12
- def tokenize(template, def_ldel = "{{", def_rdel = "}}"):
13
- """
14
- Tokenize a mustache template
15
-
16
- Tokenizes a mustache template in a generator fashion,
17
- using file-like objects. It also accepts a string containing
18
- the template.
19
-
20
-
21
- Arguments:
22
-
23
- template -- a file-like object, or a string of a mustache template
24
-
25
- def_ldel -- The default left delimiter
26
- ("{{" by default, as in spec compliant mustache)
27
-
28
- def_rdel -- The default right delimiter
29
- ("}}" by default, as in spec compliant mustache)
30
-
31
-
32
- Returns:
33
-
34
- A generator of mustache tags in the form of a tuple
35
-
36
- -- (tag_type, tag_key)
37
-
38
- Where tag_type is one of:
39
- * literal
40
- * section
41
- * inverted section
42
- * end
43
- * partial
44
- * no escape
45
-
46
- And tag_key is either the key or in the case of a literal tag,
47
- the literal itself.
48
- """
49
- ...
12
+ linesep: str
50
13
 
51
14
  python3: bool
52
15
 
@@ -55,7 +18,7 @@ def unicode(x, y):
55
18
 
56
19
  g_token_cache: dict
57
20
 
58
- def render(template = "", data = {}, partials_path = ".", partials_ext = "mustache", partials_dict = {}, padding = "", def_ldel = "{{", def_rdel = "}}", scopes = None, warn = False, keep = False):
21
+ def render(template = '', data = {}, partials_path = '.', partials_ext = 'mustache', partials_dict = {}, padding = '', def_ldel = '{{', def_rdel = '}}', scopes = None, warn = False, keep = False):
59
22
  """
60
23
  Render a mustache template.
61
24
 
@@ -1,12 +1,13 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:18.000840 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.646226 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
 
10
+
10
11
  class ChevronError(SyntaxError, metaclass=type):
11
12
  ...
12
13
 
@@ -34,7 +35,7 @@ def parse_tag(template, l_del, r_del):
34
35
  """
35
36
  ...
36
37
 
37
- def tokenize(template, def_ldel = "{{", def_rdel = "}}"):
38
+ def tokenize(template, def_ldel = '{{', def_rdel = '}}'):
38
39
  """
39
40
  Tokenize a mustache template
40
41
 
@@ -1,111 +1,28 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.935145 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.598355 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
+ import metaflow
10
11
  if typing.TYPE_CHECKING:
11
12
  import metaflow.plugins.cards.card_modules.card
12
- import metaflow.plugins.cards.card_modules.basic
13
- import typing
14
13
  import metaflow.plugins.cards.card_modules.components
14
+ import typing
15
15
 
16
- class LogComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
17
- def __init__(self, data = None):
18
- ...
19
- def render(self):
20
- ...
21
- ...
22
-
23
- class ErrorComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
24
- def __init__(self, headline, error_message):
25
- ...
26
- def render(self):
27
- ...
28
- ...
29
-
30
- class ArtifactsComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
31
- def __init__(self, title = None, subtitle = None, data = {}):
32
- ...
33
- def render(self):
34
- ...
35
- ...
36
-
37
- class TableComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
38
- def __init__(self, title = None, subtitle = None, headers = [], data = [[]], vertical = False):
39
- ...
40
- @classmethod
41
- def validate(cls, headers, data):
42
- ...
43
- def render(self):
44
- ...
45
- ...
46
-
47
- class ImageComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
48
- def __init__(self, src = None, label = None, title = None, subtitle = None):
49
- ...
50
- def render(self):
51
- ...
52
- ...
53
-
54
- class SectionComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
55
- def __init__(self, title = None, subtitle = None, columns = None, contents = []):
56
- ...
57
- @classmethod
58
- def render_subcomponents(cls, component_array, additional_allowed_types = [str, dict], allow_unknowns = False):
59
- ...
60
- def render(self):
61
- ...
62
- ...
63
-
64
- class MarkdownComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
65
- def __init__(self, text = None):
66
- ...
67
- def render(self):
68
- ...
69
- ...
70
-
71
- class MetaflowCardComponent(object, metaclass=type):
72
- @property
73
- def component_id(self):
74
- ...
75
- @component_id.setter
76
- def component_id(self, value):
77
- ...
78
- def update(self, *args, **kwargs):
79
- """
80
- #FIXME document
81
- """
82
- ...
83
- def render(self):
84
- """
85
- `render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard`
86
- """
87
- ...
88
- ...
89
-
90
- class TaskToDict(object, metaclass=type):
91
- def __init__(self, only_repr = False, runtime = False):
92
- ...
93
- def __call__(self, task, graph = None):
94
- ...
95
- def object_type(self, object):
96
- ...
97
- def parse_image(self, data_object):
98
- ...
99
- def infer_object(self, artifact_object):
100
- ...
101
- ...
102
-
103
- def render_safely(func):
104
- """
105
- This is a decorator that can be added to any `MetaflowCardComponent.render`
106
- The goal is to render subcomponents safely and ensure that they are JSON serializable.
107
- """
108
- ...
16
+ from .basic import LogComponent as LogComponent
17
+ from .basic import ErrorComponent as ErrorComponent
18
+ from .basic import ArtifactsComponent as ArtifactsComponent
19
+ from .basic import TableComponent as TableComponent
20
+ from .basic import ImageComponent as ImageComponent
21
+ from .basic import SectionComponent as SectionComponent
22
+ from .basic import MarkdownComponent as MarkdownComponent
23
+ from .card import MetaflowCardComponent as MetaflowCardComponent
24
+ from .convert_to_native_type import TaskToDict as TaskToDict
25
+ from .renderer_tools import render_safely as render_safely
109
26
 
110
27
  def create_component_id(component):
111
28
  ...
@@ -390,20 +307,20 @@ class ProgressBar(UserComponent, metaclass=type):
390
307
 
391
308
  Parameters
392
309
  ----------
393
- max : int
310
+ max : int, default 100
394
311
  The maximum value of the progress bar.
395
- label : str, optional
312
+ label : str, optional, default None
396
313
  Optional label for the progress bar.
397
- value : int, optional
314
+ value : int, default 0
398
315
  Optional initial value of the progress bar.
399
- unit : str, optional
316
+ unit : str, optional, default None
400
317
  Optional unit for the progress bar.
401
- metadata : str, optional
318
+ metadata : str, optional, default None
402
319
  Optional additional information to show on the progress bar.
403
320
  """
404
- def __init__(self, max: int = 100, label: str = None, value: int = 0, unit: str = None, metadata: str = None):
321
+ def __init__(self, max: int = 100, label: typing.Optional[str] = None, value: int = 0, unit: typing.Optional[str] = None, metadata: typing.Optional[str] = None):
405
322
  ...
406
- def update(self, new_value: int, metadata: str = None):
323
+ def update(self, new_value: int, metadata: typing.Optional[str] = None):
407
324
  ...
408
325
  def render(self, *args, **kwargs):
409
326
  ...
@@ -1,12 +1,13 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.985110 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.633226 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
 
10
+
10
11
  class TypeResolvedObject(tuple, metaclass=type):
11
12
  """
12
13
  TypeResolvedObject(data, is_image, is_table)
@@ -1,19 +1,13 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.985331 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.633410 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- import typing
10
- if typing.TYPE_CHECKING:
11
- import metaflow.plugins.cards.card_modules.basic
12
9
 
13
- class SerializationErrorComponent(metaflow.plugins.cards.card_modules.basic.ErrorComponent, metaclass=type):
14
- def __init__(self, component_name, error_message):
15
- ...
16
- ...
10
+ from .basic import SerializationErrorComponent as SerializationErrorComponent
17
11
 
18
12
  def render_safely(func):
19
13
  """
@@ -1,96 +1,19 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.928319 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.593789 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
+ import metaflow
9
10
  import typing
10
11
  if typing.TYPE_CHECKING:
11
- import metaflow
12
12
  import metaflow.plugins.cards.card_modules.card
13
13
 
14
- class MetaflowCard(object, metaclass=type):
15
- """
16
- Metaflow cards derive from this base class.
17
-
18
- Subclasses of this class are called *card types*. The desired card
19
- type `T` is defined in the `@card` decorator as `@card(type=T)`.
20
-
21
- After a task with `@card(type=T, options=S)` finishes executing, Metaflow instantiates
22
- a subclass `C` of `MetaflowCard` that has its `type` attribute set to `T`, i.e. `C.type=T`.
23
- The constructor is given the options dictionary `S` that contains arbitrary
24
- JSON-encodable data that is passed to the instance, parametrizing the card. The subclass
25
- may override the constructor to capture and process the options.
26
-
27
- The subclass needs to implement a `render(task)` method that produces the card
28
- contents in HTML, given the finished task that is represented by a `Task` object.
29
-
30
- Attributes
31
- ----------
32
- type : str
33
- Card type string. Note that this should be a globally unique name, similar to a
34
- Python package name, to avoid name clashes between different custom cards.
35
-
36
- Parameters
37
- ----------
38
- options : Dict
39
- JSON-encodable dictionary containing user-definable options for the class.
40
- """
41
- def __init__(self, options = {}, components = [], graph = None):
42
- ...
43
- def render(self, task: "metaflow.Task") -> str:
44
- """
45
- Produce custom card contents in HTML.
46
-
47
- Subclasses override this method to customize the card contents.
48
-
49
- Parameters
50
- ----------
51
- task : Task
52
- A `Task` object that allows you to access data from the finished task and tasks
53
- preceding it.
54
-
55
- Returns
56
- -------
57
- str
58
- Card contents as an HTML string.
59
- """
60
- ...
61
- def render_runtime(self, task, data):
62
- ...
63
- def refresh(self, task, data):
64
- ...
65
- def reload_content_token(self, task, data):
66
- ...
67
- ...
68
-
69
- class MetaflowCardComponent(object, metaclass=type):
70
- @property
71
- def component_id(self):
72
- ...
73
- @component_id.setter
74
- def component_id(self, value):
75
- ...
76
- def update(self, *args, **kwargs):
77
- """
78
- #FIXME document
79
- """
80
- ...
81
- def render(self):
82
- """
83
- `render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard`
84
- """
85
- ...
86
- ...
87
-
88
- def render_safely(func):
89
- """
90
- This is a decorator that can be added to any `MetaflowCardComponent.render`
91
- The goal is to render subcomponents safely and ensure that they are JSON serializable.
92
- """
93
- ...
14
+ from .card import MetaflowCard as MetaflowCard
15
+ from .card import MetaflowCardComponent as MetaflowCardComponent
16
+ from .renderer_tools import render_safely as render_safely
94
17
 
95
18
  class TestStringComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
96
19
  def __init__(self, text):
@@ -128,7 +51,7 @@ class TestNonEditableCard(metaflow.plugins.cards.card_modules.card.MetaflowCard,
128
51
  ...
129
52
 
130
53
  class TestMockCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
131
- def __init__(self, options = {"key": "dummy_key"}, **kwargs):
54
+ def __init__(self, options = {'key': 'dummy_key'}, **kwargs):
132
55
  ...
133
56
  def render(self, task):
134
57
  ...
@@ -140,7 +63,7 @@ class TestErrorCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metac
140
63
  ...
141
64
 
142
65
  class TestTimeoutCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
143
- def __init__(self, options = {"timeout": 50}, **kwargs):
66
+ def __init__(self, options = {'timeout': 50}, **kwargs):
144
67
  ...
145
68
  def render(self, task):
146
69
  ...
@@ -1,56 +1,13 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.947721 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.618259 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
 
10
- class CardDatastore(object, metaclass=type):
11
- @classmethod
12
- def get_storage_root(cls, storage_type):
13
- ...
14
- def __init__(self, flow_datastore, pathspec = None):
15
- ...
16
- @classmethod
17
- def get_card_location(cls, base_path, card_name, uuid, card_id = None, suffix = "html"):
18
- ...
19
- @staticmethod
20
- def info_from_path(path, suffix = "html"):
21
- """
22
- Args:
23
- path (str): The path to the card
24
-
25
- Raises:
26
- Exception: When the card_path is invalid
27
-
28
- Returns:
29
- CardInfo
30
- """
31
- ...
32
- def save_data(self, uuid, card_type, json_data, card_id = None):
33
- ...
34
- def save_card(self, uuid, card_type, card_html, card_id = None, overwrite = True):
35
- ...
36
- def create_full_path(self, card_path):
37
- ...
38
- def get_card_names(self, card_paths):
39
- ...
40
- def get_card_html(self, path):
41
- ...
42
- def get_card_data(self, path):
43
- ...
44
- def cache_locally(self, path, save_path = None):
45
- """
46
- Saves the data present in the `path` the `metaflow_card_cache` directory or to the `save_path`.
47
- """
48
- ...
49
- def extract_data_paths(self, card_type = None, card_hash = None, card_id = None):
50
- ...
51
- def extract_card_paths(self, card_type = None, card_hash = None, card_id = None):
52
- ...
53
- ...
10
+ from .card_datastore import CardDatastore as CardDatastore
54
11
 
55
12
  def resumed_info(task):
56
13
  ...
@@ -1,73 +1,23 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.944992 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.616315 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
+ import metaflow
9
10
  import typing
10
11
  if typing.TYPE_CHECKING:
11
- import metaflow.plugins.cards.card_modules.card
12
- import metaflow.exception
13
12
  import metaflow.plugins.cards.card_modules.basic
14
- import metaflow.plugins.cards.card_modules.components
15
13
 
16
- class MetaflowCardComponent(object, metaclass=type):
17
- @property
18
- def component_id(self):
19
- ...
20
- @component_id.setter
21
- def component_id(self, value):
22
- ...
23
- def update(self, *args, **kwargs):
24
- """
25
- #FIXME document
26
- """
27
- ...
28
- def render(self):
29
- """
30
- `render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard`
31
- """
32
- ...
33
- ...
34
-
35
- class ErrorComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
36
- def __init__(self, headline, error_message):
37
- ...
38
- def render(self):
39
- ...
40
- ...
41
-
42
- class SectionComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
43
- def __init__(self, title = None, subtitle = None, columns = None, contents = []):
44
- ...
45
- @classmethod
46
- def render_subcomponents(cls, component_array, additional_allowed_types = [str, dict], allow_unknowns = False):
47
- ...
48
- def render(self):
49
- ...
50
- ...
51
-
52
- class UserComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
53
- def update(self, *args, **kwargs):
54
- ...
55
- ...
56
-
57
- def create_component_id(component):
58
- ...
59
-
60
- class StubComponent(metaflow.plugins.cards.card_modules.components.UserComponent, metaclass=type):
61
- def __init__(self, component_id):
62
- ...
63
- def update(self, *args, **kwargs):
64
- ...
65
- ...
66
-
67
- class ComponentOverwriteNotSupportedException(metaflow.exception.MetaflowException, metaclass=type):
68
- def __init__(self, component_id, card_id, card_type):
69
- ...
70
- ...
14
+ from .card_modules.card import MetaflowCardComponent as MetaflowCardComponent
15
+ from .card_modules.basic import ErrorComponent as ErrorComponent
16
+ from .card_modules.basic import SectionComponent as SectionComponent
17
+ from .card_modules.components import UserComponent as UserComponent
18
+ from .card_modules.components import create_component_id as create_component_id
19
+ from .card_modules.components import StubComponent as StubComponent
20
+ from .exception import ComponentOverwriteNotSupportedException as ComponentOverwriteNotSupportedException
71
21
 
72
22
  RUNTIME_CARD_RENDER_INTERVAL: int
73
23
 
@@ -1,21 +1,17 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.943282 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.614796 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
+ import metaflow
9
10
  import typing
10
11
  if typing.TYPE_CHECKING:
11
12
  import metaflow.exception
12
13
 
13
- class MetaflowException(Exception, metaclass=type):
14
- def __init__(self, msg = "", lineno = None):
15
- ...
16
- def __str__(self):
17
- ...
18
- ...
14
+ from ...exception import MetaflowException as MetaflowException
19
15
 
20
16
  TYPE_CHECK_REGEX: str
21
17
 
@@ -1,40 +1,20 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.922195 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.585583 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
+ import metaflow
9
10
  import typing
10
11
  if typing.TYPE_CHECKING:
11
12
  import metaflow.exception
12
- import metaflow.metaflow_current
13
13
  import metaflow.decorators
14
14
 
15
- class MetaflowException(Exception, metaclass=type):
16
- def __init__(self, msg = "", lineno = None):
17
- ...
18
- def __str__(self):
19
- ...
20
- ...
21
-
22
- class MetaflowExceptionWrapper(Exception, metaclass=type):
23
- def __init__(self, exc = None):
24
- ...
25
- def __reduce__(self):
26
- ...
27
- def __getstate__(self):
28
- ...
29
- def __setstate__(self, state):
30
- ...
31
- def __repr__(self):
32
- ...
33
- def __str__(self):
34
- ...
35
- ...
36
-
37
- current: metaflow.metaflow_current.Current
15
+ from ..exception import MetaflowException as MetaflowException
16
+ from ..exception import MetaflowExceptionWrapper as MetaflowExceptionWrapper
17
+ from ..metaflow_current import current as current
38
18
 
39
19
  NUM_FALLBACK_RETRIES: int
40
20