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


##########
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:
   And this not tested before, so I was add test case for both: pickle_id 
exists or not



-- 
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