airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Split out and handle 'params' in mapped operator

Open uranusjr opened this issue 3 years ago • 0 comments

Allow using params in expanding kwargs. Fix #24014.

Syntax unlocked:

# Two tasks with params={"a": 1} and params={"b": 2}.
MyOperator.partial(task_id="t").expand(params=[{"a": 1}, {"b": 2}])

# Two tasks with params={"a": 0, "b": 1} and params={"a": 0, "b": 2}.
# DAG-level params are also merged. If there are duplicated keys, the
# priority is mapped -> task-partial -> DAG.
MyOperator.partial(task_id="t", params={"a": 0}).expand(params=[{"b": 1}, {"b": 2}])

uranusjr avatar Sep 01 '22 08:09 uranusjr