uranusjr commented on code in PR #54528:
URL: https://github.com/apache/airflow/pull/54528#discussion_r2303243042
##########
airflow-core/src/airflow/api/common/delete_dag.py:
##########
@@ -88,4 +88,34 @@ def delete_dag(dag_id: str, keep_records_in_log: bool =
True, session: Session =
.execution_options(synchronize_session="fetch")
)
+ # Clean up DAG-specific permissions
+ _cleanup_dag_permissions(dag_id, session)
+
return count
+
+
+def _cleanup_dag_permissions(dag_id: str, session: Session) -> None:
+ """
+ Clean up DAG-specific permissions from the auth manager.
+
+ This delegates the cleanup to the appropriate auth manager implementation.
+ """
+ try:
+ from airflow.api_fastapi.app import get_auth_manager
+
+ auth_manager = get_auth_manager()
Review Comment:
Should these lines be expected to fail? I feel they should be moved outside
the try block.
--
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]