[AIRFLOW-604] Revert .first() to .one()

.one() enforces the integrity of airflow as we
expect
a tuple to be returned here. If not the database
is
inconsistent and airflow should error out.

Dear Airflow Maintainers,

.one() enforces the integrity of airflow as we
expect
a tuple to be returned here. If not the database
is
inconsistent and airflow should error out.

partially reverts: https://github.com/apache
/incubator-airflow/pull/1730

Closes #1858 from bolkedebruin/AIRFLOW-604
This commit is contained in:
Bolke de Bruin 2016-10-30 18:54:59 -04:00 коммит произвёл Li Xuanji
Родитель 5616c029dc
Коммит 527e3ecdb8
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -3654,10 +3654,10 @@ class DagRun(Base):
DR.dag_id == self.dag_id,
DR.execution_date == self.execution_date,
DR.run_id == self.run_id
).first()
if dr:
self.id = dr.id
self.state = dr.state
).one()
self.id = dr.id
self.state = dr.state
@staticmethod
@provide_session