Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change to treeify_and_or #5803

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft

change to treeify_and_or #5803

wants to merge 26 commits into from

Conversation

kylemumma
Copy link
Member

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Copy link

codecov bot commented Apr 19, 2024

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

❌ Failed Test Results:

Completed 1686 tests with 1 failed, 1683 passed and 2 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
pytest

Test name:
tests.query.parser.test_mql_query::test_recursion_error_query

Envs:
- default
Traceback (most recent call last):
File ".../query/parser/test_mql_query.py", line 2806, in test_recursion_error_query
res, _ = parse_mql_query(error_mql, context, get_dataset("generic_metrics"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../query/mql/parser.py", line 1096, in parse_mql_query
_post_process(query, [_treeify_or_and_conditions], settings)
File ".../query/snql/parser.py", line 1471, in _post_process
func(query)
File ".../query/snql/parser.py", line 1018, in _treeify_or_and_conditions
query.transform_expressions(transform)
File ".../snuba/query/init.py", line 322, in transform_expressions
self.__condition.transform(func) if self.__condition else None
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/expressions.py", line 389, in transform
parameters=tuple(map(lambda child: child.transform(func), self.parameters)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/expressions.py", line 389, in <lambda>
parameters=tuple(map(lambda child: child.transform(func), self.parameters)),
^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/expressions.py", line 389, in transform
parameters=tuple(map(lambda child: child.transform(func), self.parameters)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/expressions.py", line 389, in <lambda>
parameters=tuple(map(lambda child: child.transform(func), self.parameters)),
^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/expressions.py", line 389, in transform
parameters=tuple(map(lambda child: child.transform(func), self.parameters)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/expressions.py", line 389, in <lambda>
parameters=tuple(map(lambda child: child.transform(func), self.parameters)),
^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/expressions.py", line 389, in transform
parameters=tuple(map(lambda child: child.transform(func), self.parameters)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/expressions.py", line 389, in <lambda>
parameters=tuple(map(lambda child: child.transform(func), self.parameters)),
^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/expressions.py", line 391, in transform
return func(transformed)
^^^^^^^^^^^^^^^^^
File ".../query/snql/parser.py", line 1014, in transform
return combine_or_conditions(exp.parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/conditions.py", line 278, in combine_or_conditions
return _combine_conditions(conditions, BooleanFunctions.OR)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/conditions.py", line 290, in _combine_conditions
return _combine_conditions_old(conditions, function)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/conditions.py", line 329, in _combine_conditions_old
function, conditions[0], _combine_conditions_old(conditions[1:], function)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/conditions.py", line 329, in _combine_conditions_old
function, conditions[0], _combine_conditions_old(conditions[1:], function)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../snuba/query/conditions.py", line 329, in _combine_conditions_old
function, conditions[0], _combine_conditions_old(conditions[1:], function)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Previous line repeated 940 more times]
File ".../snuba/query/conditions.py", line 323, in _combine_conditions_old
assert function in (BooleanFunctions.AND, BooleanFunctions.OR)
^^^^^^^^
RecursionError: maximum recursion depth exceeded in comparison

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant