kaxil opened a new pull request, #73960:
URL: https://github.com/apache/airflow/pull/73960

   When a short-circuit task skips its downstream tasks, the worker sends their 
task ids to the Execution API `skip-downstream` route. The route turned each 
bare task id into `(task_id, -1)`. A task mapped over a literal list gets task 
instances `0..n-1` when the Dag run is created, so there is no `map_index=-1` 
row to match and none of them were skipped.
   
   Direct children of the short-circuit are still caught afterwards by 
`NotPreviouslySkippedDep`, so this shows up further downstream. The Dag in 
#55225 runs `dummy1 >> dummy2 >> dummy3.expand(x=[1, 2, 3]) >> publish` with 
`trigger_rule="none_failed"` and `ignore_downstream_trigger_rules=True`. 
`dummy2` and `publish` were skipped, but all three `dummy3` instances ran, 
because a skipped `dummy2` satisfies `none_failed`.
   
   A bare task id now skips every task instance of that task in the run, and a 
`(task_id, map_index)` pair still skips exactly one instance. That is what 
`DownstreamTasksSkipped` documents ("List of task_ids to skip or a list of 
tuples with task_id and map_index to skip"). Airflow sends bare ids only from 
`SkipMixin.skip()` in the Task SDK and the standard provider, and only when the 
skipping task is unmapped, where skipping every instance of a downstream task 
is the intended result. The request payload is unchanged.
   
   The Dag from the issue, run by the scheduler before and after the change:
   
   ![Before: dummy3 map indexes 0, 1 and 2 succeed](./original-before.png)
   
   ![After: dummy3 map indexes 0, 1 and 2 are skipped](./original-after.png)
   
   related: #55225
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
 You can add this file in a follow-up commit after the PR is created so you 
know the PR number.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to