fix(sqla): avoid unnecessary groupby for when no metrics (#18579)

This commit is contained in:
Ville Brofeldt
2022-02-04 10:47:47 +02:00
committed by GitHub
parent 8b0634c9ed
commit 55cd7fb412
3 changed files with 8 additions and 2 deletions

View File

@@ -154,6 +154,7 @@ class TestPostChartDataApi(BaseTestChartDataApi):
# assert
self.assert_row_count(rv, expected_row_count)
assert "GROUP BY" not in rv.json["result"][0]["query"]
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
@mock.patch(
@@ -184,6 +185,7 @@ class TestPostChartDataApi(BaseTestChartDataApi):
# assert
self.assert_row_count(rv, expected_row_count)
assert "GROUP BY" not in rv.json["result"][0]["query"]
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
@mock.patch(
@@ -200,6 +202,7 @@ class TestPostChartDataApi(BaseTestChartDataApi):
# assert
self.assert_row_count(rv, expected_row_count)
assert "GROUP BY" not in rv.json["result"][0]["query"]
def test_with_incorrect_result_type__400(self):
self.query_context_payload["result_type"] = "qwerty"