amoghrajesh commented on code in PR #49173:
URL: https://github.com/apache/airflow/pull/49173#discussion_r2041560407
##########
providers/common/io/src/airflow/providers/common/io/xcom/backend.py:
##########
@@ -131,7 +130,7 @@ def serialize_value( # type: ignore[override]
threshold = _get_threshold()
if threshold < 0 or len(s_val_encoded) < threshold: # Either no
threshold or value is small enough.
if AIRFLOW_V_3_0_PLUS:
- return s_val
+ return BaseXCom.serialize_value(value)
Review Comment:
Sounds good.
##########
providers/common/io/src/airflow/providers/common/io/xcom/backend.py:
##########
@@ -160,9 +159,18 @@ def deserialize_value(result) -> Any:
Compression is inferred from the file extension.
"""
- data = BaseXCom.deserialize_value(result)
+ base_xcom_deser_result = BaseXCom.deserialize_value(result)
+ data = base_xcom_deser_result
+
+ if not AIRFLOW_V_3_0_PLUS:
+ try:
+ # When XComObjectStorageBackend is used, xcom value will be
serialized using json.dumps
+ # likely, we need to deserialize it using json.loads
+ data = json.loads(base_xcom_deser_result, cls=XComDecoder)
+ except (TypeError, ValueError):
+ pass
Review Comment:
Should we re raise this one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]