GertL opened a new pull request, #74570:
URL: https://github.com/apache/airflow/pull/74570

   `GET /api/v2/importErrors` called `DagModel.get_dag_id_to_team_name_mapping` 
once for every import error on the page that has registered Dags, so a page of 
N errors made N extra queries.
   
   The endpoint now collects the Dag ids of the whole page and resolves their 
teams in a single call. Authorization is unchanged: each file is still checked 
with `batch_is_authorized_dag` against its own Dags and their teams, and the 
stacktrace is redacted exactly as before. This matches how the same endpoint 
already resolves bundle teams for unregistered-file errors 
(`DagBundleModel.get_team_names`).
   
   ### Tests
   
   - New `test_team_names_are_resolved_once_per_page`: three import errors in 
three files give one mapping call covering all three Dag ids, while each file 
is still authorized with its own Dag and team. It fails on the previous 
implementation.
   - `tests/unit/api_fastapi/core_api/routes/public/test_import_error.py` 
passes (50 tests).
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   **Enola**: these insights were provided by enola 
https://github.com/enola-labs/enola
   Generated-by: Claude Code following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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