turbaszek commented on a change in pull request #12327:
URL: https://github.com/apache/airflow/pull/12327#discussion_r523415279



##########
File path: airflow/models/xcom.py
##########
@@ -235,30 +235,40 @@ def serialize_value(value: Any):
             return json.dumps(value).encode('UTF-8')
         except (ValueError, TypeError):
             log.error(
-                "Could not serialize the XCOM value into JSON. "
+                "Could not serialize the XCom value into JSON. "
                 "If you are using pickles instead of JSON "
-                "for XCOM, then you need to enable pickle "
-                "support for XCOM in your airflow config."
+                "for XCom, then you need to enable pickle "
+                "support for XCom in your airflow config."
             )
             raise
 
     @staticmethod
-    def deserialize_value(result) -> Any:
-        """Deserialize Xcom value from str or pickle object"""
+    def deserialize_value(result: "XCom") -> Any:
+        """Deserialize XCom value from str or pickle object"""
         enable_pickling = conf.getboolean('core', 'enable_xcom_pickling')
         if enable_pickling:
             return pickle.loads(result.value)
         try:
             return json.loads(result.value.decode('UTF-8'))
         except JSONDecodeError:
             log.error(
-                "Could not deserialize the XCOM value from JSON. "
+                "Could not deserialize the XCom value from JSON. "
                 "If you are using pickles instead of JSON "
-                "for XCOM, then you need to enable pickle "
-                "support for XCOM in your airflow config."
+                "for XCom, then you need to enable pickle "
+                "support for XCom in your airflow config."
             )
             raise
 
+    def orm_deserialize_value(self) -> Any:
+        """
+        Deserialize method which is used to reconstruct ORM XCom object.
+
+        This method should be overridden in custom XCom backends to avoid
+        unnecessary request or other resource consuming operations when
+        creating XCom orm model

Review comment:
       Good suggestion! Done in 529e911




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to