Skip to content

Mark DAGModel stale and associate bundle on import errors #49769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 28, 2025

Conversation

sunank200
Copy link
Collaborator

@sunank200 sunank200 commented Apr 25, 2025

When a file parse encounters an import error, update the corresponding DagModel (filtered by file loc) to set has_import_errors, bundle_name, and is_stale in one go. This restores the intended behaviour, where DAGs with import errors are deactivated and flagged immediately.

I have tested this locally by adding import errors to DAG file. It marked it as stale and DAG was not shown in the list. Once import errors were resolved DAG was visible again.

Closes #49618
Closes: #49617


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@sunank200 sunank200 requested a review from vatsrahul1001 April 25, 2025 08:43
@sunank200 sunank200 force-pushed the mark-stale-with-import-errors branch from 40f3a54 to ef9bbbf Compare April 25, 2025 08:43
@sunank200 sunank200 marked this pull request as ready for review April 25, 2025 08:50
@pierrejeambrun
Copy link
Member

Tested locally, also fixes #49617

@sunank200 sunank200 force-pushed the mark-stale-with-import-errors branch from ef9bbbf to 9988349 Compare April 25, 2025 08:57
@phanikumv phanikumv requested review from uranusjr and dstandish April 25, 2025 09:04
@sunank200 sunank200 force-pushed the mark-stale-with-import-errors branch from 64418a9 to d9e05f3 Compare April 25, 2025 09:11
@vatsrahul1001
Copy link
Contributor

Verified this works

@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.0.1 milestone Apr 25, 2025
@sunank200 sunank200 requested review from kaxil and ashb April 27, 2025 20:09
When a file parse encounters an import error, update the corresponding DagModel (filtered by fileloc) to set has_import_errors, bundle_name, and is_stale in one go. This restores intended behavior where DAGs with import errors are deactivated and flagged immediately. Closes apache#49618.
@sunank200 sunank200 force-pushed the mark-stale-with-import-errors branch from d9e05f3 to 5f5b20f Compare April 27, 2025 20:09
@uranusjr uranusjr merged commit 7b0b7ee into apache:main Apr 28, 2025
51 checks passed
@uranusjr uranusjr deleted the mark-stale-with-import-errors branch April 28, 2025 04:46
@sunank200 sunank200 self-assigned this Apr 28, 2025
kaxil pushed a commit that referenced this pull request Apr 28, 2025
jroachgolf84 pushed a commit to jroachgolf84/airflow that referenced this pull request Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants