From 9ffaaf3a6a9726b6862aca6b68030637b3370684 Mon Sep 17 00:00:00 2001 From: johncmerfeld Date: Wed, 13 Nov 2024 11:25:15 -0600 Subject: [PATCH] make boolean check explicit --- airflow/utils/db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airflow/utils/db.py b/airflow/utils/db.py index 7995c1a802d6..41e4e411e0b1 100644 --- a/airflow/utils/db.py +++ b/airflow/utils/db.py @@ -1557,7 +1557,9 @@ def __setstate__(self, state: Any) -> None: self._session = get_current_task_instance_session() def __bool__(self) -> bool: - return check_query_exists(self._select_asc, session=self._session) + if check := check_query_exists(self._select_asc, session=self._session) is not None: + return check + return False def __eq__(self, other: Any) -> bool: if not isinstance(other, collections.abc.Sequence):