You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/07/10 01:35:50 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #32474: Refactor Sqlalchemy queries to 2.0 style (Part 5)

uranusjr commented on code in PR #32474:
URL: https://github.com/apache/airflow/pull/32474#discussion_r1257612130


##########
airflow/cli/commands/dag_command.py:
##########
@@ -302,7 +302,9 @@ def dag_next_execution(args) -> None:
         print("[INFO] Please be reminded this DAG is PAUSED now.", file=sys.stderr)
 
     with create_session() as session:
-        last_parsed_dag: DagModel = session.query(DagModel).filter(DagModel.dag_id == dag.dag_id).one()
+        last_parsed_dag: DagModel = session.scalars(
+            select(DagModel).where(DagModel.dag_id == dag.dag_id)
+        ).one()

Review Comment:
   ```suggestion
           last_parsed_dag: DagModel = session.scalar(
               select(DagModel).where(DagModel.dag_id == dag.dag_id)
           )
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org