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


##########
airflow/api_connexion/endpoints/dag_endpoint.py:
##########
@@ -81,11 +82,21 @@ def get_dag_details(
     for key, value in dag.__dict__.items():
         if not key.startswith("_") and not hasattr(dag_model, key):
             setattr(dag_model, key, value)
+
+    serialized_dag = 
session.scalar(select(SerializedDagModel).where(SerializedDagModel.dag_id == 
dag_id))
+    dataset_expression = {}
+    if serialized_dag:
+        dataset_expression = serialized_dag.get_dataset_expression()

Review Comment:
   ```suggestion
       if serialized_dag := 
session.scalar(select(SerializedDagModel).where(SerializedDagModel.dag_id == 
dag_id)):
           dataset_expression = serialized_dag.get_dataset_expression()
       else:
           dataset_expression = {}
   ```
   
   if this is not too long



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