Skip to content

Conversation

@uplsh580
Copy link
Contributor

@uplsh580 uplsh580 commented Jan 28, 2026

Related Issue

Issue: #59272 (comment)

Problem

Import errors from DAG bundle files that fail to create any DAGs were not visible in the web UI. This occurred because the API endpoints (GET /importErrors and GET /importErrors/{id}) used JOIN operations between ParseImportError and DagModel tables. When a file had an import error but no DAGs were successfully created, there was no corresponding DagModel entry, causing the import error to be filtered out by the JOIN.

Solution

Modified the import error API endpoints to:

  1. First retrieve all ParseImportError entries without JOIN operations
  2. Perform permission checks in-memory after fetching the data
  3. For files without associated DAGs, check if the user has access to any DAG within the same bundle (bundle-level permission check)
  4. Use relative_fileloc and bundle_name instead of fileloc for proper DAG lookup

Changes

  • get_import_errors: Changed from JOIN-based filtering to post-fetch permission filtering
  • get_import_error: Added bundle-level permission check for files without DAGs
  • Added integration test to verify import error visibility when no DAGs are created

Testing

Added integration test test_dag_bundle_import_error_with_no_dags_is_visible_in_web that:

  • Creates a DAG file with intentional import errors (using invalid parameter)
  • Parses the file using BundleDagBag to capture import errors
  • Stores the import error in DB without creating any DAGs
  • Verifies the import error is visible via both GET /importErrors/{id} and GET /importErrors endpoints

Notes

  • total_entries reflects the count before permission filtering, which matches the original behavior where JOIN filtered out unauthorized entries at the query level
  • The actual returned count may be less due to permission filtering, but this is acceptable for pagination requirements

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
  • Cursor

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Jan 28, 2026
@uplsh580 uplsh580 changed the title Fix import errors not showing in web UI for local bundles, git bundles when DAG creation fails Fix import errors not showing in web UI for bundles(local, git) when DAG creation fails Jan 28, 2026
@uplsh580
Copy link
Contributor Author

Validation

Local Dag Bundle

image image image

Git Dag Bundle

스크린샷 2026-01-29 오전 1 55 23 스크린샷 2026-01-29 오전 1 55 31 스크린샷 2026-01-29 오전 1 55 46

@uplsh580 uplsh580 force-pushed the web/importerror branch 3 times, most recently from bc19563 to b829fb2 Compare January 29, 2026 15:38
@uplsh580
Copy link
Contributor Author

This was fixed in PR #61163.

@uplsh580 uplsh580 closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant