jason810496 commented on code in PR #54309: URL: https://github.com/apache/airflow/pull/54309#discussion_r2265161706
########## airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_stats.py: ########## @@ -75,22 +75,23 @@ def get_dag_stats( result_dag_ids = [] dag_state_data = {} - for dag_id, state, count in query_result: - dag_state_data[(dag_id, state)] = count - if dag_id not in result_dag_ids: - result_dag_ids.append(dag_id) + for dag_id, state, dag_display_name, count in query_result: + dag_state_data[(dag_id, dag_display_name, state)] = count + if (dag_id, dag_display_name) not in result_dag_ids: + result_dag_ids.append((dag_id, dag_display_name)) Review Comment: May I ask why do we need to add `dag_display_name` in the pair as the key of the `dag_state_data` dictionary. ########## airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_stats.py: ########## @@ -75,22 +75,23 @@ def get_dag_stats( result_dag_ids = [] dag_state_data = {} - for dag_id, state, count in query_result: - dag_state_data[(dag_id, state)] = count - if dag_id not in result_dag_ids: - result_dag_ids.append(dag_id) + for dag_id, state, dag_display_name, count in query_result: + dag_state_data[(dag_id, dag_display_name, state)] = count + if (dag_id, dag_display_name) not in result_dag_ids: + result_dag_ids.append((dag_id, dag_display_name)) Review Comment: It seems that we can remain the loop as existed implementation, since `dag_id` is the primary key in model. -- 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