From d3781120bdb21b25b5d40aa3ebca0fb40f6e8ce7 Mon Sep 17 00:00:00 2001 From: Feng Lu Date: Mon, 4 Feb 2019 21:23:33 -0800 Subject: [PATCH] Revert "Debug bf860a29a3d2bb25900fc36c6888f3a833830575. Replace" As this change breaks 1.9 build: https://screenshot.googleplex.com/Q2L1sUCzQb4 (missing timezone module import). This reverts commit 811e261de26350852b5394bfe5a653ebf07b6cfc. Change-Id: Id505d8e154e7fd47ad533b3e3009bdfbd4750c36 GitOrigin-RevId: 55d9502405de7512f8b7044af92951639ea59532 --- airflow/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/models.py b/airflow/models.py index 1930bfcaf8f..efe43eded4d 100755 --- a/airflow/models.py +++ b/airflow/models.py @@ -4406,7 +4406,7 @@ def get_state(self): def set_state(self, state): if self._state != state: self._state = state - self.end_date = func.now() if self._state in State.finished() else None + self.end_date = timezone.utcnow() if self._state in State.finished() else None if self.dag_id is not None: # something really weird goes on here: if you try to close the session