You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/11/07 18:23:58 UTC

[jira] [Commented] (AIRFLOW-618) Fix failing refresh_from_db() query (affects unit tests)

    [ https://issues.apache.org/jira/browse/AIRFLOW-618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15644948#comment-15644948 ] 

ASF subversion and git services commented on AIRFLOW-618:
---------------------------------------------------------

Commit f1927700380648d1e426397f79087cf7d44eb795 in incubator-airflow's branch refs/heads/master from [~jlowin]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=f192770 ]

[AIRFLOW-618] Cast DateTimes to avoid sqllite errors

For some reason, sqllite does not always match
datetimes correctly.
This causes unit test failures, in particular the
trigger_dagrun test.
Casting the datetime explicitly appears to solve
the issue.

Closes #1871 from jlowin/failing-sqlite-test


> Fix failing refresh_from_db() query (affects unit tests)
> --------------------------------------------------------
>
>                 Key: AIRFLOW-618
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-618
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Jeremiah Lowin
>
> Travis runs are failing with sqllite. Commonly, the error is traced to: 
>   File "/home/travis/build/apache/incubator-airflow/airflow/models.py", line 3657, in refresh_from_db
>     ).one()
>   File "/home/travis/build/apache/incubator-airflow/.tox/py34-cdh-airflow_backend_sqlite/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2760, in one
>     raise orm_exc.NoResultFound("No row was found for one()")
> nose.proxy.NoResultFound: No row was found for one()
> In other words, the database is finding no rows that match the query filter. Manually inspecting the database, I can see that the filter SHOULD succeed. It appears that manually casting the DateTime parameters as SQL DateTimes fixes the issue in this instance.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)