Skip to content
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

Support clearing and updating state of individual mapped task instances #22958

Merged
merged 13 commits into from Apr 20, 2022

Conversation

ephraimbuddy
Copy link
Contributor

@ephraimbuddy ephraimbuddy commented Apr 12, 2022

Provide support for UI to clear/update state of mapped task instances

TODO:

  • Add test at UI side

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:webserver Webserver related Issues labels Apr 12, 2022
@bbovenzi bbovenzi changed the title Support clearing and updating state of mapped task instances Support clearing and updating state of individual mapped task instances Apr 13, 2022
@bbovenzi
Copy link
Contributor

Testing with the UI branch mapped-instance-actions. And everything appears to me working. 👍

@ephraimbuddy ephraimbuddy force-pushed the clearing-and-marking-mapped-task branch from 95a0a2e to 916ae06 Compare April 13, 2022 20:08
airflow/api/common/mark_tasks.py Outdated Show resolved Hide resolved
airflow/models/dag.py Outdated Show resolved Hide resolved
airflow/api/common/mark_tasks.py Outdated Show resolved Hide resolved
airflow/models/dag.py Outdated Show resolved Hide resolved
airflow/models/dag.py Outdated Show resolved Hide resolved
airflow/www/views.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Apr 15, 2022
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@ephraimbuddy ephraimbuddy force-pushed the clearing-and-marking-mapped-task branch from 79ee7de to 98abe5f Compare April 15, 2022 11:35
@ephraimbuddy
Copy link
Contributor Author

Not sure how to fix some mypy errors here. @uranusjr can you help. Thanks

@uranusjr

This comment was marked as outdated.

@uranusjr
Copy link
Member

uranusjr commented Apr 18, 2022

I pushed a commit for this. The entire set_task_instance_state, get_task_isntances and clear combination is a mess, so I hope this keeps everything right-ish. We’ll see…

Edit: Most things seem to work, except MSSQL does not seem to like tuple_ :(

@uranusjr uranusjr force-pushed the clearing-and-marking-mapped-task branch 2 times, most recently from 02f3f6b to 45cb2d6 Compare April 18, 2022 15:30
@bbovenzi
Copy link
Contributor

bbovenzi commented Apr 18, 2022

The latest changes got rid of map_indexes but we should still have an ability to pass multiple map indexes in a single request. Either comma separated like map_index=0%2C1 in the url or as multiple params like &map_index=0&map_index=1

@uranusjr
Copy link
Member

I added a commit to support &map_index=0&map_index=1 This is translated to [(task_id, 0), (task_id, 1)] before being passed to set_state.

@uranusjr uranusjr force-pushed the clearing-and-marking-mapped-task branch 2 times, most recently from 22581b4 to 0a52609 Compare April 19, 2022 10:04
Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

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

/confirm, /failed and /success work. But /clear is not processing multiple map_index params chained together.

The UI branch at mapped-instance-actions is up-to-date if you want to manually test it.

@uranusjr
Copy link
Member

Because I forgot to modify /clear to expect multiple map_index params 🤦‍♂️

@uranusjr uranusjr force-pushed the clearing-and-marking-mapped-task branch from 0a52609 to a890173 Compare April 20, 2022 02:40
@uranusjr uranusjr force-pushed the clearing-and-marking-mapped-task branch from a890173 to b1b2fd1 Compare April 20, 2022 13:53
Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

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

Everything is working as expected from the UI now

@ashb ashb force-pushed the clearing-and-marking-mapped-task branch from b1b2fd1 to 19ba72a Compare April 20, 2022 16:41
@ashb ashb merged commit 4fa718e into apache:main Apr 20, 2022
@jedcunningham jedcunningham added changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) area:dynamic-task-mapping AIP-42 labels Apr 25, 2022
@jedcunningham jedcunningham added this to the Airflow 2.3.0 milestone Apr 26, 2022
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:dynamic-task-mapping AIP-42 area:webserver Webserver related Issues changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) full tests needed We need to run full set of tests for this PR to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants