fuatcakici opened a new issue, #34604: URL: https://github.com/apache/airflow/issues/34604
### Apache Airflow version 2.7.1 ### What happened After changing the states of some of the tasks that failed to SUCCESS in a DAG run, we call the `update_state` function in order to update the state of that particular DAG run. However, at this point we get an AttributeError from [here](https://github.com/apache/airflow/blob/556791b13d4e4c10f95f3cb4c6079f548447e1b8/airflow/models/dagrun.py#L1043) in **dagrun.py**. We believe this is probably caused by [this change in this PR](https://github.com/apache/airflow/pull/30496/files#diff-649fbbf224bab54417f03338c27d0fdb3c3336e53a522a13dfd9806c99f63137R922), where `self.state` was probably expected to give an output in the format `<TaskInstanceState.SUCCESS: 'success'>`, but it simply gives an output in the format `'success'` instead. Hence, `self.state.value` ends up giving an AttributeError instead of the state, e.g., `'success'`. ### What you think should happen instead Replacing `self.state.value` with `self.state` in the line in question and the one below should solve the issue. ### How to reproduce Simply calling the function `update_state` on a finished DAG run (finished because the function `_emit_duration_stats_for_finished_state` called in `update_state` simply returns if the state is RUNNING without reaching the erroneous lines) should give this error. ### Operating System Amazon Linux 2 ### Versions of Apache Airflow Providers _No response_ ### 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]
