diff --git a/sdk/python/kfp/components/_data_passing.py b/sdk/python/kfp/components/_data_passing.py index 9fcad5ba2e1..da89ae321c3 100644 --- a/sdk/python/kfp/components/_data_passing.py +++ b/sdk/python/kfp/components/_data_passing.py @@ -45,6 +45,8 @@ def _deserialize_bool(s) -> bool: def _serialize_json(obj) -> str: + if isinstance(obj, str): + return obj import json def default_serializer(obj): if hasattr(obj, 'to_struct'): @@ -55,6 +57,8 @@ def default_serializer(obj): def _serialize_base64_pickle(obj) -> str: + if isinstance(obj, str): + return obj import base64 import pickle return base64.b64encode(pickle.dumps(obj)).decode('ascii')