jason810496 commented on code in PR #47270:
URL: https://github.com/apache/airflow/pull/47270#discussion_r1997459746
##########
airflow/api_fastapi/core_api/routes/public/import_error.py:
##########
@@ -36,18 +42,38 @@
ImportErrorResponse,
)
from airflow.api_fastapi.core_api.openapi.exceptions import
create_openapi_http_exception_doc
+from airflow.api_fastapi.core_api.security import (
+ AccessView,
+ GetUserDep,
+ requires_access_dag,
+ requires_access_view,
+)
+from airflow.models import DagModel
from airflow.models.errors import ParseImportError
+if TYPE_CHECKING:
+ from sqlalchemy.orm import Session
+
+REDACTED_STACKTRACE = "REDACTED - you do not have read permission on all DAGs
in the file"
import_error_router = AirflowRouter(tags=["Import Error"],
prefix="/importErrors")
+def get_file_dag_ids(session: Session, filename: str) -> set[str]:
+ return {dag_id for dag_id in
session.scalars(select(DagModel.dag_id).where(DagModel.fileloc == filename))}
Review Comment:
We need `readable_dag_ids.intersection` and `file_dag_ids.issubset` some set
operation in
https://github.com/jason810496/airflow/blob/feature/AIP-84/auth/import_error/airflow/api_fastapi/core_api/routes/public/import_error.py#L91-L101
--
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]