Taragolis commented on code in PR #35339:
URL: https://github.com/apache/airflow/pull/35339#discussion_r1379061352


##########
airflow/utils/cli.py:
##########
@@ -269,7 +269,7 @@ def get_dag_by_pickle(pickle_id: int, session: Session = 
NEW_SESSION) -> DAG:
     """Fetch DAG from the database using pickling."""
     from airflow.models import DagPickle
 
-    dag_pickle = session.scalar(select(DagPickle).where(DagPickle.id == 
pickle_id)).first()
+    dag_pickle = session.scalar(select(DagPickle).where(DagPickle.id == 
pickle_id).limit(1))

Review Comment:
   The output of `session.scalar(select(DagPickle).where(DagPickle.id == 
pickle_id)` could be DagPickle object in case of requested id exists, or None 
if it not exists, both of this object doesn't have method `first()`
   
   Most probably the issue happen when this function changed to new SQLALchemy 
API instead of legacy Query API.



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to