-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError while using the function update_state #34604
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
Before manually drilling down, would you be willing to supply an example DAG that is able to reproduce the bug? Can be anonymized. Otherwise we would be happy also if you have started investigating, if possible, to receive an PR as fix as well. |
This issue is occurring for us since our upgrade from Airflow 2.6.1 to 2.7.1. After doing some digging, I suspect the cause is 83f5950 by @ephraimbuddy. This makes changes to DagRun.find(), which now possibly no longer correctly loads the state as a DagRunState, but as a string. Not 100% certain though. |
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 in dagrun.py.We believe this is probably caused by this change in this PR, where
self.state
was probably expected to give an output in the format<DagRunState.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
withself.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 inupdate_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?
Code of Conduct
The text was updated successfully, but these errors were encountered: