ktmud commented on code in PR #20799:
URL: https://github.com/apache/superset/pull/20799#discussion_r930443744
##########
tests/integration_tests/sqllab_tests.py:
##########
@@ -406,22 +407,19 @@ def test_search_query_on_text(self):
self.assertEqual(2, len(data))
self.assertIn("birth", data[0]["sql"])
- def test_search_query_on_time(self):
+ def test_search_query_filter_by_time(self):
self.run_some_queries()
self.login("admin")
first_query_time = (
db.session.query(Query).filter_by(sql=QUERY_1).one()
).start_time
second_query_time = (
- db.session.query(Query).filter_by(sql=QUERY_3).one()
+ db.session.query(Query).filter_by(sql=QUERY_2).one()
).start_time
- # Test search queries on time filter
- from_time = "from={}".format(int(first_query_time))
- to_time = "to={}".format(int(second_query_time))
- params = [from_time, to_time]
- resp = self.get_resp("/superset/search_queries?" + "&".join(params))
- data = json.loads(resp)
- self.assertEqual(2, len(data))
+ print(first_query_time, second_query_time)
+ # pylint: disable=line-too-long
+ url =
f"/superset/search_queries?from={floor(first_query_time)}&to={ceil(second_query_time)}"
Review Comment:
Bycatch: test may fail if `to` time is smaller than second query start time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]