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


##########
airflow/www/views.py:
##########
@@ -1463,7 +1463,10 @@ def rendered_k8s(self, session: Session = NEW_SESSION):
         map_index = request.args.get('map_index', -1, type=int)
         logging.info("Retrieving rendered templates.")
 
-        dag: DAG = current_app.dag_bag.get_dag(dag_id)
+        dag: DAG = get_airflow_app().dag_bag.get_dag(dag_id)
+        if task_id is None:
+            logging.warning("Task id not passed in the request")
+            abort(400)

Review Comment:
   This can be moved much earlier in the function to avoid unnecessary work 
(getting a DAG is not trivial).



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