-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Add map_index validation in categorize_task_instances#54791
Add map_index validation in categorize_task_instances#54791jason810496 merged 2 commits intoapache:mainfrom
Conversation
Why
private function categorize_task_instances in bulk service would fetch all task instances based on task_id and categorize those fetched task instance as matched ones without checking their map_index, leading to the issue where we will delete all task instances with same task_id when we just want to delete some of task instances in the task
How
- add
map_indexvalidation - add test for
categorize_task_instances
^ 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.
jason810496
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Thanks for the PR.
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_task_instances.py
Outdated
Show resolved
Hide resolved
4a83ef2 to
02995c7
Compare
airflow-core/tests/unit/api_fastapi/core_api/services/public/test_task_instances.py
Outdated
Show resolved
Hide resolved
02995c7 to
6ef6932
Compare
6ef6932 to
5adcb03
Compare
jason810496
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I will check whether does this patch needs to backport to v3-0-test as well.
Not sure if the TI bulk action is included in 3.1 or 3.0.x .
jason810496
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked, there isn't airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py module in v3-0-test branch. We don't need to backport this patch.