You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/10/31 02:32:06 UTC
[airflow] branch main updated: change .first() to .scalar() (#27323)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 37c0038a18 change .first() to .scalar() (#27323)
37c0038a18 is described below
commit 37c0038a18ace092079d23988f76d90493ff294c
Author: Ayush Sharma <11...@users.noreply.github.com>
AuthorDate: Mon Oct 31 08:01:58 2022 +0530
change .first() to .scalar() (#27323)
Co-authored-by: eladkal <45...@users.noreply.github.com>
---
airflow/models/serialized_dag.py | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/airflow/models/serialized_dag.py b/airflow/models/serialized_dag.py
index 7ac98e7b8c..9c3c96871c 100644
--- a/airflow/models/serialized_dag.py
+++ b/airflow/models/serialized_dag.py
@@ -149,12 +149,8 @@ class SerializedDagModel(Base):
(timezone.utcnow() - timedelta(seconds=min_update_interval)) < cls.last_updated,
)
)
- .first()
- is not None
+ .scalar()
):
- # TODO: .first() is not None can be changed to .scalar() once we update to sqlalchemy 1.4+
- # as the associated sqlalchemy bug for MySQL was fixed
- # related issue : https://github.com/sqlalchemy/sqlalchemy/issues/5481
return False
log.debug("Checking if DAG (%s) changed", dag.dag_id)