This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new dfa695a48e Remove dot value (#36712)
dfa695a48e is described below
commit dfa695a48ec53f97b9443205d00d06ce0c67271d
Author: fuatcakici <[email protected]>
AuthorDate: Wed Jan 10 20:58:33 2024 +0200
Remove dot value (#36712)
The update_state function in the DagRun class fails as ever since an update
was made to Airflow, the state of the DagRun is returned as a string instead of
an actual DagRunState. However, should this be fixed in the future, this change
would still not affect anything since the state is called as a string here,
which would return the value without needing to specify ".value" anyway.
Co-authored-by: fuat.cakici <[email protected]>
---
airflow/models/dagrun.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/airflow/models/dagrun.py b/airflow/models/dagrun.py
index 791e1351cf..6a1e71d4d7 100644
--- a/airflow/models/dagrun.py
+++ b/airflow/models/dagrun.py
@@ -1040,8 +1040,8 @@ class DagRun(Base, LoggingMixin):
duration = self.end_date - self.start_date
timer_params = {"dt": duration, "tags": self.stats_tags}
- Stats.timing(f"dagrun.duration.{self.state.value}.{self.dag_id}",
**timer_params)
- Stats.timing(f"dagrun.duration.{self.state.value}", **timer_params)
+ Stats.timing(f"dagrun.duration.{self.state}.{self.dag_id}",
**timer_params)
+ Stats.timing(f"dagrun.duration.{self.state}", **timer_params)
@provide_session
def verify_integrity(self, *, session: Session = NEW_SESSION) -> None: