Skip to content

fix(events-v2): Fix search filter #13454

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

Merged
merged 2 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/sentry/api/endpoints/organization_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def get_v2(self, request, organization):
}, status=400)

data_fn = partial(
lambda *args, **kwargs: transform_aliases_and_query(*args, **kwargs)['data'],
lambda **kwargs: transform_aliases_and_query(
skip_conditions=True, **kwargs)['data'],
referrer='api.organization-events-v2',
**snuba_args
)
Expand Down
7 changes: 4 additions & 3 deletions src/sentry/utils/snuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def get_arrayjoin(column):
return match.groups()[0]


def transform_aliases_and_query(*args, **kwargs):
def transform_aliases_and_query(skip_conditions=False, **kwargs):
"""
Convert aliases in selected_columns, groupby, aggregation, conditions,
orderby and arrayjoin fields to their internal Snuba format and post the
Expand Down Expand Up @@ -441,7 +441,8 @@ def handle_condition(cond):
return cond

if conditions:
kwargs['conditions'] = [handle_condition(condition) for condition in conditions]
kwargs['conditions'] = ([handle_condition(condition) for condition in conditions]
if skip_conditions is False else conditions)

if orderby:
order_by_column = orderby.lstrip('-')
Expand All @@ -453,7 +454,7 @@ def handle_condition(cond):

kwargs['arrayjoin'] = arrayjoin_map.get(arrayjoin, arrayjoin)

result = raw_query(*args, **kwargs)
result = raw_query(**kwargs)

# Translate back columns that were converted to snuba format
for col in result['meta']:
Expand Down