From 065ee094cfec880f95a8024f7c247556b6be36e4 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 a45b14ae666e4..283edc4022abb 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):