atul-astronomer opened a new issue, #48730:
URL: https://github.com/apache/airflow/issues/48730

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   New version is picked when version is changed during dagrun
   
   
![Image](https://github.com/user-attachments/assets/5271c1bb-184b-4d7d-a32e-de8241f53e01)
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   1. Create a dagrun with below code (v1):
   ```python
   from datetime import datetime
   
   from airflow.providers.standard.operators.empty import EmptyOperator
   from airflow.sdk import DAG
   
   from providers.standard.src.airflow.providers.standard.operators.bash import 
BashOperator
   
   with DAG(
       dag_id="version_change", schedule=None, start_date=datetime(1970, 1, 1), 
catchup=False, tags=["taskmap1"]
   ) as dag:
   
       task1 = EmptyOperator(task_id='task1')
       task2 = BashOperator(task_id='task2', bash_command="sleep 20")
       task3 = EmptyOperator(task_id='task3')
   
   task1 >> task2 >> task3
   
   ``` 
   2. Trigger dagrun again and change code once task1 is completed to create v2 
version. (I have updated catchup and tags parameter)
   ```python
   from datetime import datetime
   
   from airflow.providers.standard.operators.empty import EmptyOperator
   from airflow.sdk import DAG
   
   from providers.standard.src.airflow.providers.standard.operators.bash import 
BashOperator
   
   with DAG(
       dag_id="version_change", schedule=None, start_date=datetime(1970, 1, 1), 
catchup=True, tags=["taskmap"]
   ) as dag:
   
       task1 = EmptyOperator(task_id='task1')
       task2 = BashOperator(task_id='task2', bash_command="sleep 20")
       task3 = EmptyOperator(task_id='task3')
   
   task1 >> task2 >> task3
   ``` 
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### 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