You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by di...@apache.org on 2020/08/03 21:24:24 UTC
[airflow] branch v1-10-test updated: Make XCom 2.7 compatible
This is an automated email from the ASF dual-hosted git repository.
dimberman pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v1-10-test by this push:
new ca0dd1a Make XCom 2.7 compatible
ca0dd1a is described below
commit ca0dd1a024c66093e29f4924dbd44153ac03b250
Author: Daniel Imberman <da...@gmail.com>
AuthorDate: Mon Aug 3 14:23:18 2020 -0700
Make XCom 2.7 compatible
---
airflow/models/xcom.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/airflow/models/xcom.py b/airflow/models/xcom.py
index 0b6a81d..9861c2c 100644
--- a/airflow/models/xcom.py
+++ b/airflow/models/xcom.py
@@ -234,7 +234,7 @@ class BaseXCom(Base, LoggingMixin):
raise
@staticmethod
- def deserialize_value(result) -> Any:
+ def deserialize_value(result):
# TODO: "pickling" has been deprecated and JSON is preferred.
# "pickling" will be removed in Airflow 2.0.
enable_pickling = conf.getboolean('core', 'enable_xcom_pickling')
@@ -253,11 +253,13 @@ class BaseXCom(Base, LoggingMixin):
def resolve_xcom_backend():
"""Resolves custom XCom class"""
- clazz = conf.getimport("core", "xcom_backend", fallback=f"airflow.models.xcom.{BaseXCom.__name__}")
+ clazz = conf.getimport("core", "xcom_backend", fallback="airflow.models.xcom.{}"
+ .format(BaseXCom.__name__))
if clazz:
if not issubclass(clazz, BaseXCom):
raise TypeError(
- f"Your custom XCom class `{clazz.__name__}` is not a subclass of `{BaseXCom.__name__}`."
+ "Your custom XCom class `{class_name}` is not a subclass of `{base_name}`."
+ .format(class_name=clazz.__name__, base_name=BaseXCom.__name__)
)
return clazz
return BaseXCom