Skip to content

Commit

Permalink
optimization: 节点输入支持pickle序列化
Browse files Browse the repository at this point in the history
  • Loading branch information
normal-wls committed Nov 29, 2022
1 parent 5547154 commit 7c3b699
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions runtime/bamboo-pipeline/pipeline/eri/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ def _data_inputs_assemble(
cv_key = "${%s_%s}" % (k, node_id)
if len(cv_key) > 128:
raise ValueError("var key %s length exceeds 128" % cv_key)
serialized, serializer = self._serialize(v["value"])
context_values.append(
ContextValue(
pipeline_id=pipeline_id,
key=cv_key,
type=ContextValueType.COMPUTE.value,
serializer=self.JSON_SERIALIZER,
value=json.dumps(v["value"]),
serializer=serializer,
value=serialized,
code=v.get("custom_type", ""),
)
)
Expand Down Expand Up @@ -268,13 +269,14 @@ def _prepare(
if not source_act:
context_var_references[key] = Template(input_data["value"]).get_reference()
final_references[key] = set()
serialized, serializer = self._serialize(input_data["value"])
context_values.append(
ContextValue(
pipeline_id=pipeline["id"],
key=key,
type=CONTEXT_VALUE_TYPE_MAP[input_data["type"]],
serializer=self.JSON_SERIALIZER,
value=json.dumps(input_data["value"]),
serializer=serializer,
value=serialized,
code=input_data.get("custom_type", ""),
)
)
Expand Down

0 comments on commit 7c3b699

Please sign in to comment.