From ca12912ad5bc3a69e51d2c9ec315a8403eb19342 Mon Sep 17 00:00:00 2001 From: vladimir Date: Sat, 18 Mar 2023 22:06:33 +0000 Subject: [PATCH] Add a detailed apache-airflow>=2.6.0 comment --- airflow/models/xcom.py | 5 ++++- tests/models/test_taskinstance.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/airflow/models/xcom.py b/airflow/models/xcom.py index 52166b5e88114..d6d7a13872f67 100644 --- a/airflow/models/xcom.py +++ b/airflow/models/xcom.py @@ -57,8 +57,11 @@ from airflow.utils.log.logging_mixin import LoggingMixin from airflow.utils.session import NEW_SESSION, provide_session from airflow.utils.sqlalchemy import UtcDateTime + +# XCom constants below are needed for providers backward compatibility, +# which should import the constants directly after apache-airflow>=2.6.0 from airflow.utils.xcom import ( - MAX_XCOM_SIZE, # noqa: F401 (#30180 - leaving it for providers backward compatibility) + MAX_XCOM_SIZE, # noqa: F401 XCOM_RETURN_KEY, ) diff --git a/tests/models/test_taskinstance.py b/tests/models/test_taskinstance.py index 0b3779a484294..2d86cdfde5ffe 100644 --- a/tests/models/test_taskinstance.py +++ b/tests/models/test_taskinstance.py @@ -1484,7 +1484,7 @@ def test_xcom_push_flag(self, dag_maker): ti = dag_maker.create_dagrun(execution_date=timezone.utcnow()).task_instances[0] ti.task = task ti.run() - assert ti.xcom_pull(task_ids=task_id, key=models.XCOM_RETURN_KEY) is None + assert ti.xcom_pull(task_ids=task_id, key=XCOM_RETURN_KEY) is None def test_post_execute_hook(self, dag_maker): """