dkranchii commented on code in PR #67489:
URL: https://github.com/apache/airflow/pull/67489#discussion_r3305029617


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/structure.py:
##########
@@ -161,9 +161,15 @@ def structure_data(
                 )
 
         if (asset_expression := serialized_dag.dag_model.asset_expression) and 
entry_node_ref:
-            upstream_asset_nodes, upstream_asset_edges = get_upstream_assets(
-                asset_expression, entry_node_ref["id"]
-            )
+            try:
+                upstream_asset_nodes, upstream_asset_edges = 
get_upstream_assets(
+                    asset_expression, entry_node_ref["id"]
+                )
+            except TypeError as e:
+                raise HTTPException(
+                    status.HTTP_500_INTERNAL_SERVER_ERROR,
+                    f"Malformed asset_expression in Dag {dag_id!r} version 
{version_number}: {e}",
+                ) from e

Review Comment:
   @jason810496  Updated the status code. Can you please review. thanks



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