This is an automated email from the ASF dual-hosted git repository.
kaxil pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 104a8691b93 Add a test that a mapped task group skip decision stays
within its Dag run (#74390)
104a8691b93 is described below
commit 104a8691b930f625287b64c3f90f95cb79474f51
Author: Rahul Vats <[email protected]>
AuthorDate: Wed Oct 7 18:35:35 2026 +0530
Add a test that a mapped task group skip decision stays within its Dag run
(#74390)
* Read XComModel columns through xcom_entity in NotPreviouslySkippedDep
The mapped-task-group skip-decision query added in #74283 reads
XComModel.task_id/map_index/value directly in with_only_columns, which the
check-xcom-model-columns prek hook forbids, turning the repo-wide
static-check
job red for every PR. Read them through xcom_entity(query) as the hook
requires.
* Fix skip-decision tests for the xcom_v2 rename and add a cross-run guard
The skip-decision query reads xcom_v2 after #74222, so capture_orm_selects
needs that name (the read-once test was silently counting zero). Also add a
regression test that a skip decision from one Dag run does not skip the same
map index in another, which fails on the unscoped query.
* Reformat with ruff format
---
.../deps/test_not_previously_skipped_dep.py | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git
a/airflow-core/tests/unit/ti_deps/deps/test_not_previously_skipped_dep.py
b/airflow-core/tests/unit/ti_deps/deps/test_not_previously_skipped_dep.py
index 4a17e26632e..b5b79f62fb7 100644
--- a/airflow-core/tests/unit/ti_deps/deps/test_not_previously_skipped_dep.py
+++ b/airflow-core/tests/unit/ti_deps/deps/test_not_previously_skipped_dep.py
@@ -435,6 +435,28 @@ def
test_short_circuit_does_not_skip_other_mapped_task_group(session, dag_maker)
assert tis[("second.b", 1)].state != State.SKIPPED
+def test_mapped_task_group_ignores_decision_of_other_run(session, dag_maker):
+ """A skip decision recorded in one Dag run must not skip the same map
index in another run."""
+ dr, tis = _short_circuit_chain_in_mapped_group(dag_maker, session,
"test_mapped_group_other_run_dag")
+ _finish_with_skip_decisions(
+ dr,
+ tis,
+ "group.gate",
+ {1: {XCOM_SKIPMIXIN_SKIPPED: ["group.a", "group.b", "group.c"]}},
+ session=session,
+ )
+ other_dr = dag_maker.create_dagrun(
+ run_id="other_run",
+ run_type=DagRunType.MANUAL,
+ state=State.RUNNING,
+ logical_date=pendulum.datetime(2021, 1, 1),
+ )
+ other_tis = {(ti.task_id, ti.map_index): ti for ti in
other_dr.task_instances}
+ _finish_with_skip_decisions(other_dr, other_tis, "group.gate", {},
session=session)
+
+ assert NotPreviouslySkippedDep().is_met(other_tis[("group.b", 1)],
session=session)
+
+
def test_mapped_task_group_does_not_skip_task_missing_from_decision(session,
dag_maker):
"""
A decision that lists only the direct downstream, as
ignore_downstream_trigger_rules=False