Skip to content

Commit

Permalink
fix mql too
Browse files Browse the repository at this point in the history
  • Loading branch information
volokluev committed Apr 19, 2024
1 parent ffe109b commit 8215c6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions tests/query/parser/test_formula_mql_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def test_simple_formula() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -367,7 +367,7 @@ def test_simple_formula_with_leading_literals() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -433,7 +433,7 @@ def test_groupby() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -528,7 +528,7 @@ def test_curried_aggregate() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -599,7 +599,7 @@ def test_bracketing_rules() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -689,7 +689,7 @@ def test_formula_filters() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -770,7 +770,7 @@ def test_formula_groupby() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -826,7 +826,7 @@ def test_formula_scalar_value() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -875,7 +875,7 @@ def test_arbitrary_functions() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -924,7 +924,7 @@ def test_arbitrary_functions_with_formula() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason

Expand Down Expand Up @@ -982,6 +982,6 @@ def test_arbitrary_functions_with_formula_and_filters() -> None:
generic_metrics = get_dataset(
"generic_metrics",
)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected)
assert eq, reason
4 changes: 2 additions & 2 deletions tests/query/parser/test_mql_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2576,7 +2576,7 @@ def test_format_expressions_from_mql(
query_body: str, mql_context: Dict[str, Any], expected_query: Query, dataset: str
) -> None:
generic_metrics = get_dataset(dataset)
query, _ = parse_mql_query(str(query_body), mql_context, generic_metrics)
query = parse_mql_query(str(query_body), mql_context, generic_metrics)
eq, reason = query.equals(expected_query)
assert eq, reason

Expand Down Expand Up @@ -2748,7 +2748,7 @@ def test_invalid_format_expressions_from_mql(
) -> None:
generic_metrics = get_dataset("generic_metrics")
with pytest.raises(type(error), match=re.escape(str(error))):
query, _ = parse_mql_query(query_body, mql_context, generic_metrics)
parse_mql_query(query_body, mql_context, generic_metrics)


def test_pushdown_error_query():
Expand Down

0 comments on commit 8215c6d

Please sign in to comment.