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 query validation for metric_time requirements #857

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

tlento
Copy link
Contributor

@tlento tlento commented Nov 8, 2023

Resolves #825

Description

As of right now we require metric_time in the group by expression
for any metric query against cumulative metrics or derived metrics
with time offset windows or an offset_to_grain parameter set.

The current query validation was only asserting that some time
dimension was included in the group by. In the case of derived
metrics, this simply failed later in the query building phase for
any query with a different time dimension in the group by expression.

In the case of cumulative metrics, this would run an incorrectly
rendered query and then return incorrect results.

This validation change ensures that users have the proper
configuration on queries based on our current limitations.

Copy link
Contributor Author

tlento commented Nov 8, 2023

Copy link

github-actions bot commented Nov 8, 2023

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

As of right now we require metric_time in the group by expression
for any metric query against cumulative metrics or derived metrics
with time offset windows or an offset_to_grain parameter set.

The current query validation was only asserting that some time
dimension was included in the group by. In the case of derived
metrics, this simply failed later in the query building phase for
any query with a different time dimension in the group by expression.

In the case of cumulative metrics, this would run an incorrectly
rendered query and then return incorrect results.

This validation change ensures that users have the proper
configuration on queries based on our current limitations.
@tlento tlento force-pushed the fix-metric-time-requirement-validation branch from 46f9943 to 362d934 Compare November 8, 2023 23:13
@tlento tlento added the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Nov 8, 2023
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS November 8, 2023 23:13 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS November 8, 2023 23:13 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS November 8, 2023 23:13 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS November 8, 2023 23:13 — with GitHub Actions Inactive
@tlento tlento marked this pull request as ready for review November 8, 2023 23:14
Copy link
Contributor

@courtneyholcomb courtneyholcomb left a comment

Choose a reason for hiding this comment

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

LGTM!

@github-actions github-actions bot removed the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Nov 8, 2023
Base automatically changed from expand-cumulative-and-derived-metric-tests to main November 8, 2023 23:21
@tlento tlento merged commit 1410c46 into main Nov 8, 2023
20 checks passed
@tlento tlento deleted the fix-metric-time-requirement-validation branch November 8, 2023 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SL-1292] Cumulative metric validation allows queries which will not render correctly
3 participants