Repository navigation
Conversation
phanikumv
reviewed
Jun 30, 2026
When running \�irflow db clean\ with \--dag-ids\ or \--exclude-dag-ids\, the command fails on the \�sset_event\, \deadline\, and \ ask_reschedule\ tables. This occurs because the \_TableConfig\ for these tables declared \dag_id_column_name=\dag_id\, but these tables either do not have a \dag_id\ column or require a JOIN to resolve it. This change maps the correct column for \�sset_event\ and adds a join lookup for \deadline\ and \ ask_reschedule\ so they can be filtered properly without encountering SQL errors.
This ensures that the cascade-deletion behavior is covered, as a full \�irflow db clean\ run cleans base tables first, which cascade-deletes the child rows before their own dag-filter logic executes.
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix airflow db clean failure with DAG filtering on joined tables
closes: #69030
Description
When running
airflow db cleanwith--dag-idsor--exclude-dag-ids, the command previously failed with aRuntimeErroron theasset_event,deadline, andtask_rescheduletables.This occurred because the
_TableConfigfor these tables incorrectly declareddag_id_column_name="dag_id", but these tables either do not have adag_idcolumn or require a JOIN to resolve it.Changes made in this PR:
asset_event: Mapped the correct column by changing it todag_id_column_name="source_dag_id".deadline: Removed thedag_idcolumn mapping and addeddag_id_join_infoto JOIN thedag_runtable and filter bydag_run.dag_id.task_reschedule: Removed thedag_idcolumn mapping and addeddag_id_join_infoto JOIN thetask_instancetable and filter bytask_instance.dag_id.test_cleanup_with_dag_id_filtering_for_joined_tablesto explicitly verify the SQL generation and JOIN logic for these tables.Was generative AI tooling used to co-author this PR?
Claude Code (Opus 4.8)