Skip to content

Conversation

@Lee-W
Copy link
Member

@Lee-W Lee-W commented Dec 9, 2024

This behavior will be removed in airflow 3 as assets have attributes name and uri, it would be confusing to identify which attribute should be used to filter the right asset

related: #43922, #44639


^ 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 newsfragments.

Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tests fail but you probably know how to fix...

@Lee-W
Copy link
Member Author

Lee-W commented Dec 10, 2024

Some tests fail but you probably know how to fix...

I'm not sure at this moment 🤔 but will take a look later today

@Lee-W Lee-W force-pushed the deprecate-metadata-string-access branch from fdd6217 to 79ac426 Compare December 10, 2024 09:52
@Lee-W Lee-W merged commit a1622eb into apache:v2-10-test Dec 10, 2024
48 checks passed
@Lee-W Lee-W deleted the deprecate-metadata-string-access branch December 10, 2024 11:22
@utkarsharma2 utkarsharma2 added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Jan 28, 2025
@utkarsharma2 utkarsharma2 added this to the Airflow 2.10.5 milestone Jan 28, 2025
Arunodoy18 added a commit to Arunodoy18/airflow that referenced this pull request Dec 16, 2025
… active task_instances

This commit fixes a foreign key constraint violation that occurs when running
'airflow db clean' command. The issue happened when:
- A dag_version row is old (based on created_at)
- A task_instance row is recent (based on start_date) but references the old dag_version
- The cleanup tries to delete dag_version first, violating the RESTRICT FK constraint

The problem was that dag_version incorrectly listed task_instance in its
dependent_tables configuration. However, task_instance has a foreign key TO
dag_version (task_instance.dag_version_id -> dag_version.id), making
task_instance the referrer, not the dependent.

Solution:
- Removed task_instance from dag_version's dependent_tables list
- This prevents dag_version rows from being deleted when they are still
  referenced by task_instance rows that don't meet deletion criteria

Added test case to verify that dag_version rows are properly preserved when
referenced by active task_instances.

Fixes: apache#44791
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 area:dev-tools area:production-image Production image improvements and fixes changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants