uranusjr commented on code in PR #39426:
URL: https://github.com/apache/airflow/pull/39426#discussion_r1590842956


##########
airflow/models/base.py:
##########
@@ -48,7 +48,10 @@ def _get_schema():
 mapper_registry = registry(metadata=metadata)
 _sentinel = object()
 
-Base: Any = mapper_registry.generate_base()
+if TYPE_CHECKING:
+    Base = Any
+else:
+    Base = mapper_registry.generate_base()

Review Comment:
   Not technically required, but needed to get past Mypy.



##########
airflow/models/xcom.py:
##########
@@ -688,16 +684,20 @@ def _deserialize_value(result: XCom, orm: bool) -> Any:
         if orm:
             object_hook = XComDecoder.orm_object_hook
 
-        if result.value is None:
+        value = result.value
+        if isinstance(value, memoryview):
+            value = value.tobytes()

Review Comment:
   A side effect of converting the XCom SQLAlchemy code to New Style. 
SQLAlchemy seems to return `memoryview` instead of `bytes` for binary blob 
columns (`XCom.value`).



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to