GeryDeKocliko opened a new issue, #52622:
URL: https://github.com/apache/airflow/issues/52622

   ### Apache Airflow version
   
   3.0.2
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I opened the Trigger Dag form in the Airflow 3 UI and filled in parameters 
under the section “Run Parameters” (or under “Advanced Options → Configuration 
JSON”). 
   
   When I submit the form to backfill a historical date range, the DAG run is 
created and executes, but the parameters I entered are not actually passed into 
the tasks. Inside the task, references like {{ params.my_param }} or accessing 
context["params"]["my_param"] remain unset. 
   
   Although the UI shows the parameters form, these values never make it into 
the task context. 
   
   ### What you think should happen instead?
   
   When I trigger a backfill from the Airflow 3 UI and enter parameters in the 
Run Parameters or Advanced Options → Configuration JSON, these values should be 
passed to each DAG run created during the backfill.
   
   Inside the DAG, I should be able to access them using:
        •       {{ params.my_param }} in templates
        •       context["params"]["my_param"] in Python code
   
   This is how it works when triggering a single DAG run from the UI, so the 
behavior should be the same for backfills. The parameters entered in the UI 
should override the defaults defined in the DAG and be available in all 
backfilled runs.
   
   ### How to reproduce
   
   1.   Create the following DAG:
   
   ```
   from datetime import datetime
   from airflow.decorators import dag, task
   from airflow.models.param import Param, ParamsDict
   
   @task
   def test_backfill_with_params(params: ParamsDict):
       assert params.get("id") is not None
   
   @dag(
       dag_id='test_backfill',
       start_date=datetime(2023, 1, 1),
       schedule='@daily',
       catchup=False,
       default_args={'owner': 'Gery', 'retries': 0},
       params={
           "id": Param(default=None, title="My id", description="My id", 
type=["null", "string"]),
       }
   )
   def test_backfill_dag():
       test_backfill_with_params()
   
   test_backfill_dag()
   ```
   
   2.   Go to the Airflow 3 UI.
   3.   Open the Backfill modal for the test_backfill DAG.
   4.   Set a date range (e.g., start and end: 2025-06-01 00:00 and 2025-06-02 
00:00).
   5.   In the Run Parameters section, set id = "1234".
   6.   Trigger the backfill.
   
   Expected: The DAG run(s) should pass "id": "1234" to the task, and the 
assertion should pass.
   Actual: The parameter is not passed, and the task fails due to 
params.get("id") being None.
   
   ### Operating System
   
   Mac OS 14.6 (23G80)
   
   ### Versions of Apache Airflow Providers
   
   No providers
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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