Skip to content

Commit

Permalink
fixup! fix: serialization issues in GraphQL orderBy and where
Browse files Browse the repository at this point in the history
  • Loading branch information
serramatutu committed Nov 11, 2024
1 parent e445a09 commit 59ccc71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/query_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
{
"metrics": ["order_total"],
},
# ad hoc query, metric and group by
{
"metrics": ["order_total"],
"group_by": ["customer__customer_type"],
},
# saved query, all parameters
{
"saved_query": "order_metrics",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ def test_validate_query_params_adhoc_query_no_metrics() -> None:
validate_query_parameters(p)


def test_validate_query_params_saved_query_group_by() -> None:
p: QueryParameters = {
"saved_query": "sq",
"group_by": ["a", "b"],
}
with pytest.raises(ValueError):
validate_query_parameters(p)


def test_validate_query_params_adhoc_and_saved_query() -> None:
p: QueryParameters = {"metrics": ["a", "b"], "group_by": ["a", "b"], "saved_query": "a"}
with pytest.raises(ValueError):
Expand Down

0 comments on commit 59ccc71

Please sign in to comment.