dstandish commented on code in PR #26257:
URL: https://github.com/apache/airflow/pull/26257#discussion_r967179874


##########
airflow/datasets/manager.py:
##########
@@ -96,12 +96,11 @@ def _slow_path_queue_dagruns(self, dataset: DatasetModel, 
session: Session) -> N
     def _postgres_queue_dagruns(self, dataset: DatasetModel, session: Session) 
-> None:
         from sqlalchemy.dialects.postgresql import insert
 
-        stmt = 
insert(DatasetDagRunQueue).values(dataset_id=dataset.id).on_conflict_do_nothing()
-        session.execute(
-            stmt,
-            [{'target_dag_id': target_dag.dag_id} for target_dag in 
dataset.consuming_dags],
-        )
-        session.flush()
+        params = [{'target_dag_id': target_dag.dag_id} for target_dag in 
dataset.consuming_dags]
+        if params:
+            stmt = 
insert(DatasetDagRunQueue).values(dataset_id=dataset.id).on_conflict_do_nothing()
+            session.execute(stmt, params)
+            session.flush()

Review Comment:
   the other path wasn't susceptible to the issue



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to