msoni1369 commented on code in PR #37866:
URL: https://github.com/apache/airflow/pull/37866#discussion_r1510340473


##########
airflow/api_connexion/schemas/dag_schema.py:
##########
@@ -149,6 +149,16 @@ def get_params(obj: DAG):
         return {k: v.dump() for k, v in params.items()}
 
 
+class DAGDetailSchemaWithTasksInfo(DAGDetailSchema):
+    """DAG with task ids details."""
+
+    tasks = fields.Method("get_tasks", dump_only=True)
+    @staticmethod
+    def get_tasks(obj: DAG) -> list[str]:
+        """Get DAG task ids."""
+        return list(obj.task_dict.keys())

Review Comment:
   @hussein-awala, regarding your question about adding more details to the 
tasks such as upstream lists, downstream lists, setup status, teardown status, 
and other functionalities, it's feasible and beneficial.
   
   We can always add more details to the tasks as you mentioned. I have written 
flexible code to easily accommodate additional functionalities as part of the 
"DAGDetailSchemaWithTasksInfo" schema, as per future requirements. Task IDs 
play a crucial role, potentially saving numerous API calls, particularly when 
dealing with a large number of DAGs if task IDs are included in the DAG details 
API info. Also,  all these by default won't come in an API response, details 
will only come in case when "include_tasks" param is true.
   
   I understand your stance of waiting for other reviews before making any 
changes. Let's gather additional feedback to ensure alignment before proceeding 
with modifications.



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