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

fix(insights): Opportunity score forward browser name filter #83078

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

edwardgou-sentry
Copy link
Contributor

@edwardgou-sentry edwardgou-sentry commented Jan 8, 2025

  • Updates opportunity score function to forward browser.name query filter to secondary helper query

revised #82967
The previous pr was forwarding all query filters including those of type AggregateFilter, which causes the query to have a "having" clause which is unsupported. Updates to only forward browser.name to support the browser filter in the webvitals module ui.

@edwardgou-sentry edwardgou-sentry changed the title fix(insights): opportunity score fixes fix(insights): Opportunity score forward browser name filter Jan 8, 2025
@edwardgou-sentry edwardgou-sentry marked this pull request as ready for review January 8, 2025 16:15
@edwardgou-sentry edwardgou-sentry requested a review from a team as a code owner January 8, 2025 16:15
@@ -1796,11 +1796,28 @@ def _resolve_total_score_weights_function(self, column: str, alias: str | None)
if column in self.total_score_weights and self.total_score_weights[column] is not None:
return Function("toFloat64", [self.total_score_weights[column]], alias)

# Pull out browser.name filters from the query
parsed_terms = parse_search_query(self.builder.query)
query = " ".join(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if theres a cleaner way to do this, or if theres some function that already exists.
This code is to pull out any browser.name filters that exist on the original query, including those that are wrapped by parenthesis.

Copy link
Member

@mjq mjq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with any existing functions to do what you're doing with pulling the browser.name predicates out of the query, but the code you've got seems reasonable enough 👍

@edwardgou-sentry edwardgou-sentry merged commit 93e115f into master Jan 8, 2025
51 checks passed
@edwardgou-sentry edwardgou-sentry deleted the egou/fix/opp-score branch January 8, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants