syedahsn commented on code in PR #35339: URL: https://github.com/apache/airflow/pull/35339#discussion_r1379067138
########## 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: But if no DagPickle object is found, then calling the `limit()` method will still throw an Exception -- 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