chore(sqla): refactor query utils (#21811)

Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
This commit is contained in:
Ville Brofeldt
2022-10-17 10:40:42 +01:00
committed by AAfghahi
parent 9321bc6ba2
commit cdf03dfbcb

View File

@@ -1030,7 +1030,6 @@ def test_data_cache_default_timeout(
assert rv.json["result"][0]["cache_timeout"] == 3456
@pytest.mark.usefixtures("load_energy_table_with_slice")
def test_chart_cache_timeout(
test_client,
login_as_admin,
@@ -1069,7 +1068,9 @@ def test_chart_cache_timeout(
},
},
)
def test_chart_cache_timeout_not_present(login_as_admin, physical_query_context):
def test_chart_cache_timeout_not_present(
test_client, login_as_admin, physical_query_context
):
# should use datasource cache, if it's present
datasource: SqlaTable = (
@@ -1095,7 +1096,9 @@ def test_chart_cache_timeout_not_present(login_as_admin, physical_query_context)
},
},
)
def test_chart_cache_timeout_chart_not_found(login_as_admin, physical_query_context):
def test_chart_cache_timeout_chart_not_found(
test_client, login_as_admin, physical_query_context
):
# should use default timeout
physical_query_context["form_data"] = {"slice_id": 0}
@@ -1116,6 +1119,7 @@ def test_chart_cache_timeout_chart_not_found(login_as_admin, physical_query_cont
@with_feature_flags(ALLOW_ADHOC_SUBQUERY=False)
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_chart_data_subquery_not_allowed(
test_client,
login_as_admin,
physical_dataset,
physical_query_context,
@@ -1140,6 +1144,7 @@ def test_chart_data_subquery_not_allowed(
@with_feature_flags(ALLOW_ADHOC_SUBQUERY=True)
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_chart_data_subquery_allowed(
test_client,
login_as_admin,
physical_dataset,
physical_query_context,