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

Tests for cumulative metrics queried with non-default granularities #1284

Merged
merged 5 commits into from
Jun 19, 2024

Conversation

courtneyholcomb
Copy link
Contributor

@courtneyholcomb courtneyholcomb commented Jun 14, 2024

Tests!!

@cla-bot cla-bot bot added the cla:yes label Jun 14, 2024
@courtneyholcomb courtneyholcomb force-pushed the court/test-cumu-grain branch 4 times, most recently from 328dfb3 to 2177713 Compare June 14, 2024 20:35
@courtneyholcomb courtneyholcomb marked this pull request as ready for review June 14, 2024 20:38
@courtneyholcomb courtneyholcomb added the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Jun 14, 2024
@courtneyholcomb courtneyholcomb temporarily deployed to DW_INTEGRATION_TESTS June 14, 2024 20:45 — with GitHub Actions Inactive
@courtneyholcomb courtneyholcomb temporarily deployed to DW_INTEGRATION_TESTS June 14, 2024 20:45 — with GitHub Actions Inactive
@courtneyholcomb courtneyholcomb temporarily deployed to DW_INTEGRATION_TESTS June 14, 2024 20:45 — with GitHub Actions Inactive
@courtneyholcomb courtneyholcomb temporarily deployed to DW_INTEGRATION_TESTS June 14, 2024 20:45 — with GitHub Actions Inactive
@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 Jun 14, 2024
@courtneyholcomb courtneyholcomb force-pushed the court/unrestrict-cumu-grain branch from ae72a15 to 0c64b86 Compare June 19, 2024 00:13
@courtneyholcomb courtneyholcomb force-pushed the court/test-cumu-grain branch from 72912f4 to bb01173 Compare June 19, 2024 00:14
Copy link
Contributor

@tlento tlento left a comment

Choose a reason for hiding this comment

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

ted lasso woohoo

Comment on lines +515 to +518
, FIRST_VALUE(revenue_mtd) OVER (
PARTITION BY revenue_instance__ds__quarter, revenue_instance__ds__year
ORDER BY metric_time__day
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
Copy link
Contributor

Choose a reason for hiding this comment

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

Whoa, all of this works on all engines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This SQL rendering logic already existed for conversion metrics, so it should!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And also SQL engine & check query tests pass, so yes.

SELECT
revenue_instance__ds__quarter
, revenue_instance__ds__year
, FIRST_VALUE(revenue_mtd) OVER (
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh this is interesting. If it's month to date and people truncate to year that's super strange, right? It's just always month to date for January or whatever? I guess the answer is "don't do that" - but I do wonder if we should have a different default from FIRST_VALUE - I guess people can eventually override it to LAST_VALUE (which might be more sensible).

@courtneyholcomb courtneyholcomb force-pushed the court/unrestrict-cumu-grain branch from 0c64b86 to 568d048 Compare June 19, 2024 04:28
Base automatically changed from court/unrestrict-cumu-grain to main June 19, 2024 04:31
@courtneyholcomb courtneyholcomb force-pushed the court/test-cumu-grain branch from 16093de to 3cd9aa2 Compare June 19, 2024 04:43
@courtneyholcomb courtneyholcomb added the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Jun 19, 2024
@courtneyholcomb courtneyholcomb temporarily deployed to DW_INTEGRATION_TESTS June 19, 2024 04:44 — with GitHub Actions Inactive
@courtneyholcomb courtneyholcomb temporarily deployed to DW_INTEGRATION_TESTS June 19, 2024 04:44 — with GitHub Actions Inactive
@courtneyholcomb courtneyholcomb temporarily deployed to DW_INTEGRATION_TESTS June 19, 2024 04:44 — with GitHub Actions Inactive
@courtneyholcomb courtneyholcomb temporarily deployed to DW_INTEGRATION_TESTS June 19, 2024 04:44 — with GitHub Actions Inactive
@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 Jun 19, 2024
@courtneyholcomb courtneyholcomb merged commit 470cc18 into main Jun 19, 2024
29 checks passed
@courtneyholcomb courtneyholcomb deleted the court/test-cumu-grain branch June 19, 2024 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants