metaflow 2.12.4__py2.py3-none-any.whl → 2.12.5__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.
- metaflow/cli.py +1 -1
- metaflow/plugins/cards/card_cli.py +36 -25
- metaflow/plugins/cards/card_modules/basic.py +13 -0
- metaflow/plugins/pypi/conda_environment.py +7 -9
- metaflow/version.py +1 -1
- {metaflow-2.12.4.dist-info → metaflow-2.12.5.dist-info}/METADATA +2 -2
- {metaflow-2.12.4.dist-info → metaflow-2.12.5.dist-info}/RECORD +11 -11
- {metaflow-2.12.4.dist-info → metaflow-2.12.5.dist-info}/WHEEL +1 -1
- {metaflow-2.12.4.dist-info → metaflow-2.12.5.dist-info}/LICENSE +0 -0
- {metaflow-2.12.4.dist-info → metaflow-2.12.5.dist-info}/entry_points.txt +0 -0
- {metaflow-2.12.4.dist-info → metaflow-2.12.5.dist-info}/top_level.txt +0 -0
metaflow/cli.py
CHANGED
@@ -946,7 +946,7 @@ def start(
|
|
946
946
|
ctx.obj.environment = [
|
947
947
|
e for e in ENVIRONMENTS + [MetaflowEnvironment] if e.TYPE == environment
|
948
948
|
][0](ctx.obj.flow)
|
949
|
-
ctx.obj.environment.validate_environment(
|
949
|
+
ctx.obj.environment.validate_environment(ctx.obj.logger, datastore)
|
950
950
|
|
951
951
|
ctx.obj.event_logger = LOGGING_SIDECARS[event_logger](
|
952
952
|
flow=ctx.obj.flow, env=ctx.obj.environment
|
@@ -388,6 +388,22 @@ def card_read_options_and_arguments(func):
|
|
388
388
|
return wrapper
|
389
389
|
|
390
390
|
|
391
|
+
def _extract_reload_token(data, task, mf_card):
|
392
|
+
if "render_seq" not in data:
|
393
|
+
return "never"
|
394
|
+
|
395
|
+
if data["render_seq"] == "final":
|
396
|
+
# final data update should always trigger a card reload to show
|
397
|
+
# the final card, hence a different token for the final update
|
398
|
+
return "final"
|
399
|
+
elif mf_card.RELOAD_POLICY == mf_card.RELOAD_POLICY_ALWAYS:
|
400
|
+
return "render-seq-%s" % data["render_seq"]
|
401
|
+
elif mf_card.RELOAD_POLICY == mf_card.RELOAD_POLICY_NEVER:
|
402
|
+
return "never"
|
403
|
+
elif mf_card.RELOAD_POLICY == mf_card.RELOAD_POLICY_ONCHANGE:
|
404
|
+
return mf_card.reload_content_token(task, data)
|
405
|
+
|
406
|
+
|
391
407
|
def update_card(mf_card, mode, task, data, timeout_value=None):
|
392
408
|
"""
|
393
409
|
This method will be responsible for creating a card/data-update based on the `mode`.
|
@@ -432,31 +448,21 @@ def update_card(mf_card, mode, task, data, timeout_value=None):
|
|
432
448
|
- `timeout_stack_trace` : stack trace of the function if it timed out.
|
433
449
|
"""
|
434
450
|
|
435
|
-
def _reload_token():
|
436
|
-
if "render_seq" not in data:
|
437
|
-
return "never"
|
438
|
-
|
439
|
-
if data["render_seq"] == "final":
|
440
|
-
# final data update should always trigger a card reload to show
|
441
|
-
# the final card, hence a different token for the final update
|
442
|
-
return "final"
|
443
|
-
elif mf_card.RELOAD_POLICY == mf_card.RELOAD_POLICY_ALWAYS:
|
444
|
-
return "render-seq-%s" % data["render_seq"]
|
445
|
-
elif mf_card.RELOAD_POLICY == mf_card.RELOAD_POLICY_NEVER:
|
446
|
-
return "never"
|
447
|
-
elif mf_card.RELOAD_POLICY == mf_card.RELOAD_POLICY_ONCHANGE:
|
448
|
-
return mf_card.reload_content_token(task, data)
|
449
|
-
|
450
451
|
def _add_token_html(html):
|
451
452
|
if html is None:
|
452
453
|
return None
|
453
|
-
return html.replace(
|
454
|
+
return html.replace(
|
455
|
+
mf_card.RELOAD_POLICY_TOKEN,
|
456
|
+
_extract_reload_token(data=data, task=task, mf_card=mf_card),
|
457
|
+
)
|
454
458
|
|
455
459
|
def _add_token_json(json_msg):
|
456
460
|
if json_msg is None:
|
457
461
|
return None
|
458
462
|
return {
|
459
|
-
"reload_token":
|
463
|
+
"reload_token": _extract_reload_token(
|
464
|
+
data=data, task=task, mf_card=mf_card
|
465
|
+
),
|
460
466
|
"data": json_msg,
|
461
467
|
"created_on": time.time(),
|
462
468
|
}
|
@@ -740,8 +746,16 @@ def create(
|
|
740
746
|
# 3. `refresh` is implemented but it raises an exception. (We do nothing. Don't store anything.)
|
741
747
|
# 4. `refresh` is implemented but it times out. (We do nothing. Don't store anything.)
|
742
748
|
|
749
|
+
def _render_error_card(stack_trace):
|
750
|
+
_card = error_card()
|
751
|
+
token = _extract_reload_token(data, task, _card)
|
752
|
+
return _card.render(
|
753
|
+
task,
|
754
|
+
stack_trace=stack_trace,
|
755
|
+
).replace(mf_card.RELOAD_POLICY_TOKEN, token)
|
756
|
+
|
743
757
|
if error_stack_trace is not None and mode != "refresh":
|
744
|
-
rendered_content =
|
758
|
+
rendered_content = _render_error_card(error_stack_trace)
|
745
759
|
elif (
|
746
760
|
rendered_info.is_implemented
|
747
761
|
and rendered_info.timed_out
|
@@ -753,18 +767,15 @@ def create(
|
|
753
767
|
"To increase the timeout duration for card rendering, please set the `timeout` parameter in the @card decorator. "
|
754
768
|
"\nStack Trace : \n%s"
|
755
769
|
) % (timeout, rendered_info.timeout_stack_trace)
|
756
|
-
rendered_content =
|
757
|
-
task,
|
758
|
-
stack_trace=timeout_stack_trace,
|
759
|
-
)
|
770
|
+
rendered_content = _render_error_card(timeout_stack_trace)
|
760
771
|
elif (
|
761
772
|
rendered_info.is_implemented
|
762
773
|
and rendered_info.data is None
|
763
774
|
and render_error_card
|
764
775
|
and mode != "refresh"
|
765
776
|
):
|
766
|
-
rendered_content =
|
767
|
-
|
777
|
+
rendered_content = _render_error_card(
|
778
|
+
"No information rendered from card of type %s" % type
|
768
779
|
)
|
769
780
|
elif (
|
770
781
|
not rendered_info.is_implemented
|
@@ -775,7 +786,7 @@ def create(
|
|
775
786
|
"Card of type %s is a runtime time card with no `render_runtime` implemented. "
|
776
787
|
"Please implement `render_runtime` method to allow rendering this card at runtime."
|
777
788
|
) % type
|
778
|
-
rendered_content =
|
789
|
+
rendered_content = _render_error_card(message)
|
779
790
|
|
780
791
|
# todo : should we save native type for error card or error type ?
|
781
792
|
if type is not None and re.match(CARD_ID_PATTERN, type) is not None:
|
@@ -542,11 +542,24 @@ class ErrorCard(MetaflowCard):
|
|
542
542
|
|
543
543
|
type = "error"
|
544
544
|
|
545
|
+
RELOAD_POLICY = MetaflowCard.RELOAD_POLICY_ONCHANGE
|
546
|
+
|
545
547
|
def __init__(self, options={}, components=[], graph=None):
|
546
548
|
self._only_repr = True
|
547
549
|
self._graph = None if graph is None else transform_flow_graph(graph)
|
548
550
|
self._components = components
|
549
551
|
|
552
|
+
def reload_content_token(self, task, data):
|
553
|
+
"""
|
554
|
+
The reload token will change when the component array has changed in the Metaflow card.
|
555
|
+
The change in the component array is signified by the change in the component_update_ts.
|
556
|
+
"""
|
557
|
+
if task.finished:
|
558
|
+
return "final"
|
559
|
+
# `component_update_ts` will never be None. It is set to a default value when the `ComponentStore` is instantiated
|
560
|
+
# And it is updated when components added / removed / changed from the `ComponentStore`.
|
561
|
+
return "runtime-%s" % (str(data["component_update_ts"]))
|
562
|
+
|
550
563
|
def render(self, task, stack_trace=None):
|
551
564
|
RENDER_TEMPLATE = read_file(RENDER_TEMPLATE_PATH)
|
552
565
|
JS_DATA = read_file(JS_PATH)
|
@@ -48,9 +48,9 @@ class CondaEnvironment(MetaflowEnvironment):
|
|
48
48
|
# Apply conda decorator to manage the task execution lifecycle.
|
49
49
|
return ("conda",) + super().decospecs()
|
50
50
|
|
51
|
-
def validate_environment(self,
|
51
|
+
def validate_environment(self, logger, datastore_type):
|
52
52
|
self.datastore_type = datastore_type
|
53
|
-
self.
|
53
|
+
self.logger = logger
|
54
54
|
|
55
55
|
# Avoiding circular imports.
|
56
56
|
from metaflow.plugins import DATASTORES
|
@@ -165,7 +165,7 @@ class CondaEnvironment(MetaflowEnvironment):
|
|
165
165
|
self.write_to_environment_manifest([id_, platform, type_], packages)
|
166
166
|
|
167
167
|
# First resolve environments through Conda, before PyPI.
|
168
|
-
|
168
|
+
self.logger("Bootstrapping virtual environment(s) ...")
|
169
169
|
for solver in ["conda", "pypi"]:
|
170
170
|
with ThreadPoolExecutor() as executor:
|
171
171
|
results = list(
|
@@ -178,11 +178,9 @@ class CondaEnvironment(MetaflowEnvironment):
|
|
178
178
|
)
|
179
179
|
if self.datastore_type not in ["local"]:
|
180
180
|
# Cache packages only when a remote datastore is in play.
|
181
|
-
storage = self.datastore(
|
182
|
-
_datastore_packageroot(self.datastore, self.echo)
|
183
|
-
)
|
181
|
+
storage = self.datastore(_datastore_packageroot(self.datastore, echo))
|
184
182
|
cache(storage, results, solver)
|
185
|
-
|
183
|
+
self.logger("Virtual environment(s) bootstrapped!")
|
186
184
|
|
187
185
|
def executable(self, step_name, default=None):
|
188
186
|
step = next(step for step in self.flow if step.name == step_name)
|
@@ -220,7 +218,7 @@ class CondaEnvironment(MetaflowEnvironment):
|
|
220
218
|
disabled = decorator.attributes["disabled"]
|
221
219
|
if not disabled or str(disabled).lower() == "false":
|
222
220
|
environment[decorator.name] = {
|
223
|
-
k: decorator.attributes[k]
|
221
|
+
k: copy.deepcopy(decorator.attributes[k])
|
224
222
|
for k in decorator.attributes
|
225
223
|
if k != "disabled"
|
226
224
|
}
|
@@ -316,7 +314,7 @@ class CondaEnvironment(MetaflowEnvironment):
|
|
316
314
|
**environment,
|
317
315
|
**{
|
318
316
|
"package_root": _datastore_packageroot(
|
319
|
-
self.datastore, self.
|
317
|
+
self.datastore, self.logger
|
320
318
|
)
|
321
319
|
},
|
322
320
|
}
|
metaflow/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
metaflow_version = "2.12.
|
1
|
+
metaflow_version = "2.12.5"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: metaflow
|
3
|
-
Version: 2.12.
|
3
|
+
Version: 2.12.5
|
4
4
|
Summary: Metaflow: More Data Science, Less Engineering
|
5
5
|
Author: Metaflow Developers
|
6
6
|
Author-email: help@metaflow.org
|
@@ -26,7 +26,7 @@ License-File: LICENSE
|
|
26
26
|
Requires-Dist: requests
|
27
27
|
Requires-Dist: boto3
|
28
28
|
Provides-Extra: stubs
|
29
|
-
Requires-Dist: metaflow-stubs ==2.12.
|
29
|
+
Requires-Dist: metaflow-stubs ==2.12.5 ; extra == 'stubs'
|
30
30
|
|
31
31
|

|
32
32
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
metaflow/R.py,sha256=CqVfIatvmjciuICNnoyyNGrwE7Va9iXfLdFbQa52hwA,3958
|
2
2
|
metaflow/__init__.py,sha256=3GEqivYycw6mvjn-ndEFGuCdYnGztciQgEWX87vjf6M,5885
|
3
3
|
metaflow/cards.py,sha256=tP1_RrtmqdFh741pqE4t98S7SA0MtGRlGvRICRZF1Mg,426
|
4
|
-
metaflow/cli.py,sha256=
|
4
|
+
metaflow/cli.py,sha256=VXNA2qL3-OpKiEjw7-YqHWZqjL0wBcXjcvsIU1Pufkg,33746
|
5
5
|
metaflow/cli_args.py,sha256=lcgBGNTvfaiPxiUnejAe60Upt9swG6lRy1_3OqbU6MY,2616
|
6
6
|
metaflow/clone_util.py,sha256=XfUX0vssu_hPlyZfhFl1AOnKkLqvt33Qp8xNrmdocGg,2057
|
7
7
|
metaflow/cmd_with_io.py,sha256=kl53HkAIyv0ecpItv08wZYczv7u3msD1VCcciqigqf0,588
|
@@ -35,7 +35,7 @@ metaflow/tuple_util.py,sha256=_G5YIEhuugwJ_f6rrZoelMFak3DqAR2tt_5CapS1XTY,830
|
|
35
35
|
metaflow/unbounded_foreach.py,sha256=p184WMbrMJ3xKYHwewj27ZhRUsSj_kw1jlye5gA9xJk,387
|
36
36
|
metaflow/util.py,sha256=m5womQ7y-jXehuMyHPfByDbZ4HwTJxzs869cPOlMR8s,13057
|
37
37
|
metaflow/vendor.py,sha256=FchtA9tH22JM-eEtJ2c9FpUdMn8sSb1VHuQS56EcdZk,5139
|
38
|
-
metaflow/version.py,sha256=
|
38
|
+
metaflow/version.py,sha256=c_PABqNl34MzEytuF8yQavSkvAjpdC4GMlENKrxredY,28
|
39
39
|
metaflow/_vendor/__init__.py,sha256=y_CiwUD3l4eAKvTVDZeqgVujMy31cAM1qjAB-HfI-9s,353
|
40
40
|
metaflow/_vendor/typing_extensions.py,sha256=0nUs5p1A_UrZigrAVBoOEM6TxU37zzPDUtiij1ZwpNc,110417
|
41
41
|
metaflow/_vendor/zipp.py,sha256=ajztOH-9I7KA_4wqDYygtHa6xUBVZgFpmZ8FE74HHHI,8425
|
@@ -207,7 +207,7 @@ metaflow/plugins/azure/azure_utils.py,sha256=j3kAxi2oC-fMpw8YegJvqsAwxi_m7jGPxCa
|
|
207
207
|
metaflow/plugins/azure/blob_service_client_factory.py,sha256=MtyPftBxrXdXMxwhKgLepG6mtlb_2BhJLG_fvbO6D14,6527
|
208
208
|
metaflow/plugins/azure/includefile_support.py,sha256=Wv3g3RlGtLbxAh3Reg0BDLWwqavYibQNCDWddlH7XCE,4706
|
209
209
|
metaflow/plugins/cards/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
210
|
-
metaflow/plugins/cards/card_cli.py,sha256=
|
210
|
+
metaflow/plugins/cards/card_cli.py,sha256=R4J7mOit9xg514iqg0VHHwCmUZS7UxpNTBVt6Lx6SBQ,34999
|
211
211
|
metaflow/plugins/cards/card_client.py,sha256=30dFBoC3axc261GeV7QCIs_V1OHhRtS31S0wEWsjw90,9501
|
212
212
|
metaflow/plugins/cards/card_creator.py,sha256=E_NCmWPK6DzkqigtpUpeddCDbjnKF6dJcE6IvWzwiyA,7740
|
213
213
|
metaflow/plugins/cards/card_datastore.py,sha256=3K19wE0CZVvOpuYUytftIYYnHHn3pMZJE87FMD6OYlM,14244
|
@@ -218,7 +218,7 @@ metaflow/plugins/cards/component_serializer.py,sha256=Row7c_8_euJcF_I1lWHdgMRj7d
|
|
218
218
|
metaflow/plugins/cards/exception.py,sha256=2UqlNb-Kxpg6cuLu2sBEIPTIElwlVBsSpeCgDYKTxWg,5222
|
219
219
|
metaflow/plugins/cards/card_modules/__init__.py,sha256=WI2IAsFiKGyqPrHtO9S9-MbyVtUTgWJNL4xjJaBErRo,3437
|
220
220
|
metaflow/plugins/cards/card_modules/base.html,sha256=Y208ZKIZqEWWUcoBFTLTdWKAG0C8xH5lmyCRSjaN2FY,21004
|
221
|
-
metaflow/plugins/cards/card_modules/basic.py,sha256=
|
221
|
+
metaflow/plugins/cards/card_modules/basic.py,sha256=tv-Dl9qnWWOB7E1oYlvxvDNWR3EB95gnN8K1Yo8W_J8,24077
|
222
222
|
metaflow/plugins/cards/card_modules/bundle.css,sha256=ms2wOKftlPM_i6bC_4BkrmqCOj8mYw9OFvRCJF9FSV4,11981
|
223
223
|
metaflow/plugins/cards/card_modules/card.py,sha256=HspyT4d3VeXq4k3sLRLm0-2k4ScKefHu25EDuYgMtPA,4209
|
224
224
|
metaflow/plugins/cards/card_modules/components.py,sha256=Yvq9lqR_5EFVPM0ruzYTft635_dGIbkJhgxrQlPz1eg,25321
|
@@ -286,7 +286,7 @@ metaflow/plugins/metadata/service.py,sha256=ihq5F7KQZlxvYwzH_-jyP2aWN_I96i2vp92j
|
|
286
286
|
metaflow/plugins/pypi/__init__.py,sha256=0YFZpXvX7HCkyBFglatual7XGifdA1RwC3U4kcizyak,1037
|
287
287
|
metaflow/plugins/pypi/bootstrap.py,sha256=Hik3PZ_RQC8T6hEf-NE2Xr_jq2ZIUkpgUtJlx-rqJgU,5107
|
288
288
|
metaflow/plugins/pypi/conda_decorator.py,sha256=-bPxNtZKjxqOo4sj89uIp8ZVrCIontWhAp7wwRFjYpg,14189
|
289
|
-
metaflow/plugins/pypi/conda_environment.py,sha256=
|
289
|
+
metaflow/plugins/pypi/conda_environment.py,sha256=7k5GJ6S-EiSkDxnFtNpdKkCOiMKSnjOJ-2N_0fWjMHU,19230
|
290
290
|
metaflow/plugins/pypi/micromamba.py,sha256=wlVN2fm4WXFh3jVNtpDfu4XEz6VJKbmFNp0QvqlMIuI,12179
|
291
291
|
metaflow/plugins/pypi/pip.py,sha256=MAgdyP7wK7Cp6iusG6S-jeKKDCxlA9k-jMqIGvyi0Ng,12472
|
292
292
|
metaflow/plugins/pypi/pypi_decorator.py,sha256=syWk_oSQhIK9Y7OeOINMG2XVyxh9sj5uJhapwAXRBDw,5583
|
@@ -332,9 +332,9 @@ metaflow/tutorials/07-worldview/README.md,sha256=5vQTrFqulJ7rWN6r20dhot9lI2sVj9W
|
|
332
332
|
metaflow/tutorials/07-worldview/worldview.ipynb,sha256=ztPZPI9BXxvW1QdS2Tfe7LBuVzvFvv0AToDnsDJhLdE,2237
|
333
333
|
metaflow/tutorials/08-autopilot/README.md,sha256=GnePFp_q76jPs991lMUqfIIh5zSorIeWznyiUxzeUVE,1039
|
334
334
|
metaflow/tutorials/08-autopilot/autopilot.ipynb,sha256=DQoJlILV7Mq9vfPBGW-QV_kNhWPjS5n6SJLqePjFYLY,3191
|
335
|
-
metaflow-2.12.
|
336
|
-
metaflow-2.12.
|
337
|
-
metaflow-2.12.
|
338
|
-
metaflow-2.12.
|
339
|
-
metaflow-2.12.
|
340
|
-
metaflow-2.12.
|
335
|
+
metaflow-2.12.5.dist-info/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
|
336
|
+
metaflow-2.12.5.dist-info/METADATA,sha256=WNxjG7krB0L--6wpxwGN5tzT7B0SoB7wL-P7DZ4WDAI,5906
|
337
|
+
metaflow-2.12.5.dist-info/WHEEL,sha256=pOwdCRdxkCaq8tWTvnGIC-q_meWYHwmqvvQPkeaM2I4,109
|
338
|
+
metaflow-2.12.5.dist-info/entry_points.txt,sha256=IKwTN1T3I5eJL3uo_vnkyxVffcgnRdFbKwlghZfn27k,57
|
339
|
+
metaflow-2.12.5.dist-info/top_level.txt,sha256=v1pDHoWaSaKeuc5fKTRSfsXCKSdW1zvNVmvA-i0if3o,9
|
340
|
+
metaflow-2.12.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|