RabahAmrouche05 commented on code in PR #68544:
URL: https://github.com/apache/airflow/pull/68544#discussion_r3501954282


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py:
##########
@@ -253,6 +258,36 @@ def get_dags(
     )
 
 
+@dags_router.get(
+    "/folders",
+    dependencies=[Depends(requires_access_dag(method="GET"))],
+    operation_id="get_dag_folders",
+)
+def get_dag_folders(
+    readable_dags_filter: ReadableDagsFilterDep,
+    session: SessionDep,
+) -> DagFolderCollectionResponse:
+    """
+    Get the distinct folders the readable Dags live in.

Review Comment:
   The list returned here is the distinct folders, not one entry per dag, so it 
stays small even with a lot of dags. It's also a single query (the new test 
checks the count doesn't grow when you add more dags).
   
   I left it without pagination on purpose: the tree needs all the folders to 
build the hierarchy, and a limit would just hide some folders from the tree, 
which feels worse than the cost.
   
   If you still think we need a safety limit I'm fine adding one with a warning 
log, just let me know.



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