-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(experiments): ExperimentQueryRunner iteration 1 #28353
feat(experiments): ExperimentQueryRunner iteration 1 #28353
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR introduces data warehouse support and test account filtering to the ExperimentQueryRunner, with significant test coverage and query snapshots.
- Added data warehouse support in
experiment_query_runner.py
with dynamic metric value extraction based on query type - Implemented test account filtering with comprehensive test coverage across multiple filter types (person, event, cohort, etc.)
- Added new
ExperimentQuery
Pydantic model inschema.py
to handle both trends and data warehouse queries - Added cleanup mechanism in tests to properly handle S3/object storage test data
- Enhanced query construction to support both regular events and data warehouse tables with proper joins
3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
metric_property = self.query.count_query.series[0].math_property | ||
metric_value = f"toFloat(JSONExtractRaw(properties, '{metric_property}'))" | ||
if is_data_warehouse_query: | ||
metric_value = f"toFloat('{metric_property}')" | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Potential SQL injection vulnerability in metric_property interpolation. Should use parameterized queries or proper escaping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👍
4c2e54e
into
init-new-experiment-query-runner
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Merges into #28347
Changes
ExperimentQuery
.How did you test this code?
Tests should pass.