I am passing some run-time DAG params/config to a PythonOperator
in a very similar way to these Airflow docs:
def print_x(x):
print(f"x is {x}")
with DAG(
"print_x",
start_date=pendulum.datetime(2022, 6, 15, tz="UTC"),
schedule_interval=None,
catchup=False,
params={
"x": Param(42),
},
) as dag:
PythonOperator(
task_id="print_x",
op_kwargs={
"x": "{{ params.x }}",
},
python_callable=print_x,
)
But when I manually trigger the DAG I always get the default value (42) regardless of what I put into the "Trigger DAG" dialog box.
What's going wrong here?
Note: In my particular case I'm running Airflow 2.2.2 on AWS Managed Workflows for Apache Airflow (MWAA) but I don't think that should be relevant.