-
-
Save washort/470a6703a68a412a8f963b5e691b4daf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================================================================== | |
FAIL: test_get_latest_returns_when_found (tests.test_models.QueryResultTest) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/washort/Projects/redash/tests/test_models.py", line 337, in test_get_latest_returns_when_found | |
self.assertEqual(qr, found_query_result) | |
AssertionError: <QueryResult: u'1 | f6bf37efedbc0a2dfffc1caf5088d86e | 2016-10-25 15:22:01.354496+00:00'> != None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -519,7 +519,7 @@ class QueryResult(BaseModel, BelongsToOrgMixin): | |
cls.data_source == data_source).order_by(cls.retrieved_at.desc()) | |
else: | |
query = cls.select().where(cls.query_hash == query_hash, cls.data_source == data_source, | |
- peewee.SQL("retrieved_at + interval '%s second' >= now() at time zone 'utc'", | |
+ peewee.SQL("retrieved_at at time zone 'utc' + interval '%s second' >= now() at time zone 'utc'", | |
max_age)).order_by(cls.retrieved_at.desc()) | |
return query.first() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment