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):