Marcus Levine created AIRFLOW-5207:
--------------------------------------

             Summary: Mark Success and Mark Failed views error out due to DAG 
reassignment
                 Key: AIRFLOW-5207
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5207
             Project: Apache Airflow
          Issue Type: Bug
          Components: ui
    Affects Versions: 1.10.4
            Reporter: Marcus Levine
            Assignee: Marcus Levine
             Fix For: 1.10.5


When trying to clear a task after upgrading to `1.10.4`, I get the following 
traceback:
```

File "/usr/local/lib/python3.7/site-packages/airflow/www/views.py", line 1451, 
in failed future, past, State.FAILED) File 
"/usr/local/lib/python3.7/site-packages/airflow/www/views.py", line 1396, in 
_mark_task_instance_state task.dag = dag File 
"/usr/local/lib/python3.7/site-packages/airflow/models/baseoperator.py", line 
509, in dag "The DAG assigned to {} can not be changed.".format(self)) 
airflow.exceptions.AirflowException: The DAG assigned to <Task(SubDagOperator): 
my-dag> can not be changed.
```

This should be a simple fix by either dropping the `task.dag = dag` line, or if 
it is required to keep things working, just set the private attribute instead: 
`task._dag = dag`



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to