Restoring include_downstream_dags logic to clear downstream Dags#65314
Restoring include_downstream_dags logic to clear downstream Dags#65314jroachgolf84 wants to merge 11 commits into
include_downstream_dags logic to clear downstream Dags#65314Conversation
|
Hey, any updates on this? |
|
@jason810496 - can you take a look at this one for me? |
|
@bugraoz93 - do you mind taking a look at this one? |
issue-61451: Restoring include_downstream_dags logicinclude_downstream_dags logic to clear downstream Dags
|
@kaxil - do you mind taking another look? |
|
Quickest fix: git fetch upstream main && git rebase upstream/main
rm uv.lock && uv lock
git add uv.lock && git rebase --continue
git push --force-with-leaseAutomated nudge — ignore if you're not ready to rebase. This comment is updated in place on future |
8ada24e to
bd41ac1
Compare
|
@kaxil - feedback implemented. Do you mind taking another look? Thanks! |
Lee-W
left a comment
There was a problem hiding this comment.
Mostly nits, but overall this looks good. The CI failure is unrelated—rebasing on the main branch should fix it.
| ) | ||
|
|
||
| assert response.status_code == 404 | ||
| assert "child_dag" in response.json()["detail"] |
| @mock.patch("airflow.serialization.definitions.dag.SerializedDAG.clear") | ||
| def test_invalid_external_task_marker_logical_date_returns_400(self, mock_clear, test_client, session): | ||
| """A non-ISO logical_date rendered from an ExternalTaskMarker template must return 400, not 500.""" | ||
| from pendulum.parsing.exceptions import ParserError |
Co-authored-by: Wei Lee <hello@wei-lee.me>
Co-authored-by: Wei Lee <hello@wei-lee.me>
| raise HTTPException(status.HTTP_404_NOT_FOUND, str(e)) from e | ||
|
|
||
| if include_dependent_dags: | ||
| # Ensure proper access to downstream dags/tasks with dag.clear and include_dependent_dags |
There was a problem hiding this comment.
| # Ensure proper access to downstream dags/tasks with dag.clear and include_dependent_dags | |
| # Ensure proper access to downstream Dags/tasks with dag.clear and include_dependent_dags |
|
|
||
|
|
||
| def test_clear_raises_when_recursion_depth_exceeded(dag_maker, session): | ||
| """AirflowException is raised when the dependency chain depth exceeds recursion_depth.""" |
There was a problem hiding this comment.
Should it be MaxRecursionDepthError instead?
Description
Restoring behavior to clear downstream DAGs when a Task state is cleared (if applicable).
closes: #61451
Testing
Unit-tests were added/updated to test these changes. The changes were also tested E2E.
Unit Tests
The unit-tests added/updated as part of this effort can be found in these files:
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_task_instances.pyairflow-core/tests/unit/serialization/definitions/test_dag.pyThese tests can be executed using the commands below:
E2E Testing
The DAG below was used to test the changes int his PR. This DAG is made up of a parent and child DAG. The
ExternalTaskMarkerOperator is cleared in the parent DAG, the downstream Tasks in the child DAG are also cleared. That's showed in the video below.Video
issue-61451-include-downstream-tasks.mov