Skip to content

Commit

Permalink
chore(sqla): refactor query utils (#21811)
Browse files Browse the repository at this point in the history
Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
  • Loading branch information
2 people authored and AAfghahi committed Dec 15, 2022
1 parent c26be92 commit 8156d86
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/integration_tests/charts/data/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = (
Expand All @@ -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}
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 8156d86

Please sign in to comment.