metaflow 2.18.12__py2.py3-none-any.whl → 2.18.13__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/graph.py +2 -2
- metaflow/plugins/argo/argo_workflows.py +20 -25
- metaflow/plugins/argo/param_val.py +19 -0
- metaflow/plugins/cards/card_datastore.py +6 -12
- metaflow/runner/click_api.py +4 -2
- metaflow/version.py +1 -1
- {metaflow-2.18.12.dist-info → metaflow-2.18.13.dist-info}/METADATA +2 -2
- {metaflow-2.18.12.dist-info → metaflow-2.18.13.dist-info}/RECORD +15 -14
- {metaflow-2.18.12.data → metaflow-2.18.13.data}/data/share/metaflow/devtools/Makefile +0 -0
- {metaflow-2.18.12.data → metaflow-2.18.13.data}/data/share/metaflow/devtools/Tiltfile +0 -0
- {metaflow-2.18.12.data → metaflow-2.18.13.data}/data/share/metaflow/devtools/pick_services.sh +0 -0
- {metaflow-2.18.12.dist-info → metaflow-2.18.13.dist-info}/WHEEL +0 -0
- {metaflow-2.18.12.dist-info → metaflow-2.18.13.dist-info}/entry_points.txt +0 -0
- {metaflow-2.18.12.dist-info → metaflow-2.18.13.dist-info}/licenses/LICENSE +0 -0
- {metaflow-2.18.12.dist-info → metaflow-2.18.13.dist-info}/top_level.txt +0 -0
metaflow/graph.py
CHANGED
|
@@ -94,7 +94,7 @@ class DAGNode(object):
|
|
|
94
94
|
case_key = None
|
|
95
95
|
|
|
96
96
|
# handle string literals
|
|
97
|
-
if isinstance(key, ast.Str):
|
|
97
|
+
if hasattr(ast, "Str") and isinstance(key, ast.Str):
|
|
98
98
|
case_key = key.s
|
|
99
99
|
elif isinstance(key, ast.Constant):
|
|
100
100
|
case_key = key.value
|
|
@@ -171,7 +171,7 @@ class DAGNode(object):
|
|
|
171
171
|
# Get condition parameter
|
|
172
172
|
for keyword in tail.value.keywords:
|
|
173
173
|
if keyword.arg == "condition":
|
|
174
|
-
if isinstance(keyword.value, ast.Str):
|
|
174
|
+
if hasattr(ast, "Str") and isinstance(keyword.value, ast.Str):
|
|
175
175
|
condition_name = keyword.value.s
|
|
176
176
|
elif isinstance(keyword.value, ast.Constant) and isinstance(
|
|
177
177
|
keyword.value.value, str
|
|
@@ -609,7 +609,16 @@ class ArgoWorkflows(object):
|
|
|
609
609
|
# the JSON equivalent of None to please argo-workflows. Unfortunately it
|
|
610
610
|
# has the side effect of casting the parameter value to string null during
|
|
611
611
|
# execution - which needs to be fixed imminently.
|
|
612
|
-
if
|
|
612
|
+
if default_value is None:
|
|
613
|
+
default_value = json.dumps(None)
|
|
614
|
+
elif param_type == "JSON":
|
|
615
|
+
if not isinstance(default_value, str):
|
|
616
|
+
# once to serialize the default value if needed.
|
|
617
|
+
default_value = json.dumps(default_value)
|
|
618
|
+
# adds outer quotes to param
|
|
619
|
+
default_value = json.dumps(default_value)
|
|
620
|
+
else:
|
|
621
|
+
# Make argo sensors happy
|
|
613
622
|
default_value = json.dumps(default_value)
|
|
614
623
|
|
|
615
624
|
parameters[param.name] = dict(
|
|
@@ -941,11 +950,7 @@ class ArgoWorkflows(object):
|
|
|
941
950
|
Arguments().parameters(
|
|
942
951
|
[
|
|
943
952
|
Parameter(parameter["name"])
|
|
944
|
-
.value(
|
|
945
|
-
"'%s'" % parameter["value"]
|
|
946
|
-
if parameter["type"] == "JSON"
|
|
947
|
-
else parameter["value"]
|
|
948
|
-
)
|
|
953
|
+
.value(parameter["value"])
|
|
949
954
|
.description(parameter.get("description"))
|
|
950
955
|
# TODO: Better handle IncludeFile in Argo Workflows UI.
|
|
951
956
|
for parameter in self.parameters.values()
|
|
@@ -2054,7 +2059,7 @@ class ArgoWorkflows(object):
|
|
|
2054
2059
|
# {{foo.bar['param_name']}}.
|
|
2055
2060
|
# https://argoproj.github.io/argo-events/tutorials/02-parameterization/
|
|
2056
2061
|
# http://masterminds.github.io/sprig/strings.html
|
|
2057
|
-
"--%s
|
|
2062
|
+
"--%s=\\\"$(python -m metaflow.plugins.argo.param_val {{=toBase64(workflow.parameters['%s'])}})\\\""
|
|
2058
2063
|
% (parameter["name"], parameter["name"])
|
|
2059
2064
|
for parameter in self.parameters.values()
|
|
2060
2065
|
]
|
|
@@ -3842,37 +3847,27 @@ class ArgoWorkflows(object):
|
|
|
3842
3847
|
# NOTE: We need the conditional logic in order to successfully fall back to the default value
|
|
3843
3848
|
# when the event payload does not contain a key for a parameter.
|
|
3844
3849
|
# NOTE: Keys might contain dashes, so use the safer 'get' for fetching the value
|
|
3845
|
-
data_template='{{ if (hasKey $.Input.body.payload "%s") }}
|
|
3850
|
+
data_template='{{ if (hasKey $.Input.body.payload "%s") }}%s{{- else -}}{{ (fail "use-default-instead") }}{{- end -}}'
|
|
3846
3851
|
% (
|
|
3847
|
-
v,
|
|
3848
3852
|
v,
|
|
3849
3853
|
(
|
|
3850
|
-
"| toRawJson |
|
|
3854
|
+
'{{- $pv:=(get $.Input.body.payload "%s") -}}{{ if kindIs "string" $pv }}{{- $pv | toRawJson -}}{{- else -}}{{ $pv | toRawJson | toRawJson }}{{- end -}}'
|
|
3855
|
+
% v
|
|
3851
3856
|
if self.parameters[
|
|
3852
3857
|
parameter_name
|
|
3853
3858
|
]["type"]
|
|
3854
3859
|
== "JSON"
|
|
3855
|
-
else "| toRawJson
|
|
3860
|
+
else '{{- (get $.Input.body.payload "%s" | toRawJson) -}}'
|
|
3861
|
+
% v
|
|
3856
3862
|
),
|
|
3857
3863
|
),
|
|
3858
3864
|
# Unfortunately the sensor needs to
|
|
3859
3865
|
# record the default values for
|
|
3860
3866
|
# the parameters - there doesn't seem
|
|
3861
3867
|
# to be any way for us to skip
|
|
3862
|
-
value=
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
"value"
|
|
3866
|
-
]
|
|
3867
|
-
)
|
|
3868
|
-
if self.parameters[parameter_name][
|
|
3869
|
-
"type"
|
|
3870
|
-
]
|
|
3871
|
-
== "JSON"
|
|
3872
|
-
else self.parameters[
|
|
3873
|
-
parameter_name
|
|
3874
|
-
]["value"]
|
|
3875
|
-
),
|
|
3868
|
+
value=self.parameters[parameter_name][
|
|
3869
|
+
"value"
|
|
3870
|
+
],
|
|
3876
3871
|
)
|
|
3877
3872
|
.dest(
|
|
3878
3873
|
# this undocumented (mis?)feature in
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import base64
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def parse_parameter_value(base64_value):
|
|
7
|
+
val = base64.b64decode(base64_value).decode("utf-8")
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
return json.loads(val)
|
|
11
|
+
except json.decoder.JSONDecodeError:
|
|
12
|
+
# fallback to using the original value.
|
|
13
|
+
return val
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
if __name__ == "__main__":
|
|
17
|
+
base64_val = sys.argv[1]
|
|
18
|
+
|
|
19
|
+
print(parse_parameter_value(base64_val))
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
"""
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
1
|
from collections import namedtuple
|
|
6
2
|
from io import BytesIO
|
|
7
3
|
import os
|
|
@@ -67,20 +63,18 @@ class CardDatastore(object):
|
|
|
67
63
|
result = CARD_LOCALROOT
|
|
68
64
|
if result is None:
|
|
69
65
|
current_path = os.getcwd()
|
|
70
|
-
check_dir = os.path.join(current_path, DATASTORE_LOCAL_DIR
|
|
66
|
+
check_dir = os.path.join(current_path, DATASTORE_LOCAL_DIR)
|
|
71
67
|
check_dir = os.path.realpath(check_dir)
|
|
72
68
|
orig_path = check_dir
|
|
73
69
|
while not os.path.isdir(check_dir):
|
|
74
70
|
new_path = os.path.dirname(current_path)
|
|
75
71
|
if new_path == current_path:
|
|
76
|
-
|
|
72
|
+
# No longer making upward progress so we
|
|
73
|
+
# return the top level path
|
|
74
|
+
return os.path.join(orig_path, CARD_SUFFIX)
|
|
77
75
|
current_path = new_path
|
|
78
|
-
check_dir = os.path.join(
|
|
79
|
-
|
|
80
|
-
)
|
|
81
|
-
result = orig_path
|
|
82
|
-
|
|
83
|
-
return result
|
|
76
|
+
check_dir = os.path.join(current_path, DATASTORE_LOCAL_DIR)
|
|
77
|
+
return os.path.join(check_dir, CARD_SUFFIX)
|
|
84
78
|
else:
|
|
85
79
|
# Let's make it obvious we need to update this block for each new datastore backend...
|
|
86
80
|
raise NotImplementedError(
|
metaflow/runner/click_api.py
CHANGED
|
@@ -351,8 +351,10 @@ class MetaflowAPI(object):
|
|
|
351
351
|
class_dict = {
|
|
352
352
|
"__module__": "metaflow",
|
|
353
353
|
"_API_NAME": flow_file,
|
|
354
|
-
"_internal_getattr":
|
|
355
|
-
|
|
354
|
+
"_internal_getattr": staticmethod(
|
|
355
|
+
functools.partial(
|
|
356
|
+
_lazy_load_command, cli_collection, "_compute_flow_parameters"
|
|
357
|
+
)
|
|
356
358
|
),
|
|
357
359
|
"__getattr__": getattr_wrapper,
|
|
358
360
|
}
|
metaflow/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
metaflow_version = "2.18.
|
|
1
|
+
metaflow_version = "2.18.13"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: metaflow
|
|
3
|
-
Version: 2.18.
|
|
3
|
+
Version: 2.18.13
|
|
4
4
|
Summary: Metaflow: More AI and ML, 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.18.
|
|
29
|
+
Requires-Dist: metaflow-stubs==2.18.13; extra == "stubs"
|
|
30
30
|
Dynamic: author
|
|
31
31
|
Dynamic: author-email
|
|
32
32
|
Dynamic: classifier
|
|
@@ -11,7 +11,7 @@ metaflow/event_logger.py,sha256=joTVRqZPL87nvah4ZOwtqWX8NeraM_CXKXXGVpKGD8o,780
|
|
|
11
11
|
metaflow/events.py,sha256=ahjzkSbSnRCK9RZ-9vTfUviz_6gMvSO9DGkJ86X80-k,5300
|
|
12
12
|
metaflow/exception.py,sha256=_m9ZBJM0cooHRslDqfxCPQmkChqaTh6fGxp7HvISnYI,5161
|
|
13
13
|
metaflow/flowspec.py,sha256=9wsO2_QoO_VHKusKdpslfbwQREOwf0fAzF-DSEA0iZ8,41968
|
|
14
|
-
metaflow/graph.py,sha256=
|
|
14
|
+
metaflow/graph.py,sha256=b7-5hStqurdTO0RFVEhtUcwrPh2Xt3gTZkAE_B2LSOM,19311
|
|
15
15
|
metaflow/includefile.py,sha256=NXERo_halboBCjvnS5iCjnBMyCMlQMnT2mRe6kxl2xU,21978
|
|
16
16
|
metaflow/integrations.py,sha256=LlsaoePRg03DjENnmLxZDYto3NwWc9z_PtU6nJxLldg,1480
|
|
17
17
|
metaflow/lint.py,sha256=A2NdUq_MnQal_RUCMC8ZOSR0VYZGyi2mSgwPQB0UzQo,15343
|
|
@@ -36,7 +36,7 @@ metaflow/tuple_util.py,sha256=_G5YIEhuugwJ_f6rrZoelMFak3DqAR2tt_5CapS1XTY,830
|
|
|
36
36
|
metaflow/unbounded_foreach.py,sha256=p184WMbrMJ3xKYHwewj27ZhRUsSj_kw1jlye5gA9xJk,387
|
|
37
37
|
metaflow/util.py,sha256=g2SOU_CRzJLgDM_UGF9QDMANMAIHAsDRXE6S76_YzsY,14594
|
|
38
38
|
metaflow/vendor.py,sha256=A82CGHfStZGDP5pQ5XzRjFkbN1ZC-vFmghXIrzMDDNg,5868
|
|
39
|
-
metaflow/version.py,sha256=
|
|
39
|
+
metaflow/version.py,sha256=x5086WE7AkSw0-UOZF9Q1QaMHEZPAruxlGoHg71vRXs,29
|
|
40
40
|
metaflow/_vendor/__init__.py,sha256=y_CiwUD3l4eAKvTVDZeqgVujMy31cAM1qjAB-HfI-9s,353
|
|
41
41
|
metaflow/_vendor/typing_extensions.py,sha256=q9zxWa6p6CzF1zZvSkygSlklduHf_b3K7MCxGz7MJRc,134519
|
|
42
42
|
metaflow/_vendor/zipp.py,sha256=ajztOH-9I7KA_4wqDYygtHa6xUBVZgFpmZ8FE74HHHI,8425
|
|
@@ -231,7 +231,7 @@ metaflow/plugins/airflow/sensors/s3_sensor.py,sha256=iDReG-7FKnumrtQg-HY6cCUAAqN
|
|
|
231
231
|
metaflow/plugins/argo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
232
232
|
metaflow/plugins/argo/argo_client.py,sha256=oT4ZrCyE7CYEbqNN0SfoZfSHd5fYW9XtuOrQEiUd1co,17230
|
|
233
233
|
metaflow/plugins/argo/argo_events.py,sha256=_C1KWztVqgi3zuH57pInaE9OzABc2NnncC-zdwOMZ-w,5909
|
|
234
|
-
metaflow/plugins/argo/argo_workflows.py,sha256=
|
|
234
|
+
metaflow/plugins/argo/argo_workflows.py,sha256=eq_Q4gxjHoZuJItPKYjZvku_J3mc56g3GpMlSQTIiKE,217407
|
|
235
235
|
metaflow/plugins/argo/argo_workflows_cli.py,sha256=GRDsiE8QT9HEdeAUODtyyGiqePhShSkwJJ8tiPQwwiI,52992
|
|
236
236
|
metaflow/plugins/argo/argo_workflows_decorator.py,sha256=CLSjPqFTGucZ2_dSQGAYkoWWUZBQ9TCBXul4rxhDj3w,8282
|
|
237
237
|
metaflow/plugins/argo/argo_workflows_deployer.py,sha256=6kHxEnYXJwzNCM9swI8-0AckxtPWqwhZLerYkX8fxUM,4444
|
|
@@ -241,6 +241,7 @@ metaflow/plugins/argo/conditional_input_paths.py,sha256=Vtca74XbhnqAXgJJXKasLEa2
|
|
|
241
241
|
metaflow/plugins/argo/exit_hooks.py,sha256=nh8IEkzAtQnbKVnh3N9CVnVKZB39Bjm3e0LFrACsLz8,6109
|
|
242
242
|
metaflow/plugins/argo/generate_input_paths.py,sha256=loYsI6RFX9LlFsHb7Fe-mzlTTtRdySoOu7sYDy-uXK0,881
|
|
243
243
|
metaflow/plugins/argo/jobset_input_paths.py,sha256=-h0E_e0w6FMiBUod9Rf_XOSCtZv_C0exacw4q1SfIfg,501
|
|
244
|
+
metaflow/plugins/argo/param_val.py,sha256=qfMsXyT6bjfUz0eqNpbitFcps2G5XwJqOAoGLt4Jpxw,390
|
|
244
245
|
metaflow/plugins/aws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
245
246
|
metaflow/plugins/aws/aws_client.py,sha256=BTiLMXa1agjja-N73oWinaOZHs-lGPbfKJG8CqdRgaU,4287
|
|
246
247
|
metaflow/plugins/aws/aws_utils.py,sha256=5mGZLu6wwTo2KzIke_MFqiomM3sYjAkU7Fx55dIMLfg,8561
|
|
@@ -275,7 +276,7 @@ metaflow/plugins/cards/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
275
276
|
metaflow/plugins/cards/card_cli.py,sha256=h-ib-SXjJjAm-jSQC4pEmVcsM4M3lljSjOkZBxvAvRo,35763
|
|
276
277
|
metaflow/plugins/cards/card_client.py,sha256=30dFBoC3axc261GeV7QCIs_V1OHhRtS31S0wEWsjw90,9501
|
|
277
278
|
metaflow/plugins/cards/card_creator.py,sha256=Da4LOkRY3IJNcGQn1V6zlSdgVjgiFm6XMcsKOe_6v70,8784
|
|
278
|
-
metaflow/plugins/cards/card_datastore.py,sha256=
|
|
279
|
+
metaflow/plugins/cards/card_datastore.py,sha256=rSiOZWNcFMGywFAU5CVb5h0WrAw74X-qzT3exFpR7yA,12741
|
|
279
280
|
metaflow/plugins/cards/card_decorator.py,sha256=lu_m95tZRIkPp1wMlcT80aZRCbjuFapyuPXuelFCMAc,14073
|
|
280
281
|
metaflow/plugins/cards/card_resolver.py,sha256=bjyujYpGUFbLJNwXNGHlHhL4f-gVdVKebl7XW1vWDtE,717
|
|
281
282
|
metaflow/plugins/cards/card_server.py,sha256=DHv0RcepaPULWbkDahiEMrU5A281Cfb0DvHLUYd8JsU,11772
|
|
@@ -377,7 +378,7 @@ metaflow/plugins/uv/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
|
377
378
|
metaflow/plugins/uv/bootstrap.py,sha256=awFHAiZANkAlvHWCm3G1UbhVxEjJB8buoZoBa5GiKJc,4365
|
|
378
379
|
metaflow/plugins/uv/uv_environment.py,sha256=AYZICrBEq3Bv-taXktJwu9DhKFxNooPFwlcH379EYMs,2719
|
|
379
380
|
metaflow/runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
380
|
-
metaflow/runner/click_api.py,sha256=
|
|
381
|
+
metaflow/runner/click_api.py,sha256=WmhbrjS0H2gz-AZDEDe5Jrkctf9SvV4XrfgIBPW7nUI,24530
|
|
381
382
|
metaflow/runner/deployer.py,sha256=OAAMG_l3Q1ClcY_603VZnhclVkfFe3Rf8bFRodC3poc,17138
|
|
382
383
|
metaflow/runner/deployer_impl.py,sha256=q-IvwnNKPRUTpOkfzrZNrkIsjp-L-Ju75dtXmfDUqbI,7299
|
|
383
384
|
metaflow/runner/metaflow_runner.py,sha256=uo3BzcAfZ67VT_f-TPe5ZHiWHn6uuojWusOMGksvX14,18178
|
|
@@ -430,12 +431,12 @@ metaflow/user_decorators/mutable_flow.py,sha256=EywKTN3cnXPQF_s62wQaC4a4aH14j8oe
|
|
|
430
431
|
metaflow/user_decorators/mutable_step.py,sha256=-BY0UDXf_RCAEnC5JlLzEXGdiw1KD9oSrSxS_SWaB9Y,16791
|
|
431
432
|
metaflow/user_decorators/user_flow_decorator.py,sha256=2yDwZq9QGv9W-7kEuKwa8o4ZkTvuHJ5ESz7VVrGViAI,9890
|
|
432
433
|
metaflow/user_decorators/user_step_decorator.py,sha256=4558NR8RJtN22OyTwCXO80bAMhMTaRGMoX12b1GMcPc,27232
|
|
433
|
-
metaflow-2.18.
|
|
434
|
-
metaflow-2.18.
|
|
435
|
-
metaflow-2.18.
|
|
436
|
-
metaflow-2.18.
|
|
437
|
-
metaflow-2.18.
|
|
438
|
-
metaflow-2.18.
|
|
439
|
-
metaflow-2.18.
|
|
440
|
-
metaflow-2.18.
|
|
441
|
-
metaflow-2.18.
|
|
434
|
+
metaflow-2.18.13.data/data/share/metaflow/devtools/Makefile,sha256=TT4TCq8ALSfqYyGqDPocN5oPcZe2FqoCZxmGO1LmyCc,13760
|
|
435
|
+
metaflow-2.18.13.data/data/share/metaflow/devtools/Tiltfile,sha256=b6l_fjDO0wtxOkO85lFvuf3HDa6wnzHhhBG8yv1kQqk,23949
|
|
436
|
+
metaflow-2.18.13.data/data/share/metaflow/devtools/pick_services.sh,sha256=PGjQeDIigFHeoQ0asmYNdYDPIOdeYy1UYvkw2wdN4zg,2209
|
|
437
|
+
metaflow-2.18.13.dist-info/licenses/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
|
|
438
|
+
metaflow-2.18.13.dist-info/METADATA,sha256=PTPTKK93ldxAV0LUxH3dVL_rLlrAFqEzfIK2qbk07i4,6743
|
|
439
|
+
metaflow-2.18.13.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
440
|
+
metaflow-2.18.13.dist-info/entry_points.txt,sha256=RvEq8VFlgGe_FfqGOZi0D7ze1hLD0pAtXeNyGfzc_Yc,103
|
|
441
|
+
metaflow-2.18.13.dist-info/top_level.txt,sha256=v1pDHoWaSaKeuc5fKTRSfsXCKSdW1zvNVmvA-i0if3o,9
|
|
442
|
+
metaflow-2.18.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{metaflow-2.18.12.data → metaflow-2.18.13.data}/data/share/metaflow/devtools/pick_services.sh
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|