GayathriSrividya opened a new pull request, #67856: URL: https://github.com/apache/airflow/pull/67856
When a single Python file contains multiple DAGs, GET /api/v2/importErrors returns an inflated total_entries count — one entry per DAG instead of one per file. This causes pagination to be incorrect and leads to duplicate display of the same import error. Root cause: The query joined ImportError with DagModel via the DagWarning association, producing one row per DAG per import error. The total_entries count was taken from this joined result, multiplying the actual number of distinct import errors by the number of DAGs in the file. Fix: Use .distinct() on the base query so total_entries reflects unique import error rows. The DAG association query is kept separate (used only for populating the filename/stacktrace fields), ensuring the count is always one-per-file regardless of how many DAGs share that file. closes: #67525 -- 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]
