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

Remove unnecessary logic for retrieving agg time dimension for conversion metrics #1483

Merged
merged 7 commits into from
Oct 31, 2024

Conversation

WilliamDee
Copy link
Contributor

@WilliamDee WilliamDee commented Oct 29, 2024

Context

For conversion metrics, we use the agg time dimesnion of each measure to do the conversion window calculation. Since we have metric_time which is already referencing the agg time dimension of a given semantic model, we don't need to use the actual agg time dimension reference. This removes the need for additional logic in the code as well as duplication in the rendered SQL.

Note: This should not affect any changes in the query result and should be just removing unnecessary duplication in the rendered SQL

Example

Currently, the rendered SQL

...
SELECT
          , subq_25.ds__day AS ds__day <-- dupe
          , subq_25.ds__day AS metric_time__day  <-- dupe
          , subq_25.user AS user
          , subq_25.visits AS visits
        FROM (
          -- Read Elements From Semantic Model 'visits_source'
          SELECT
            1 AS visits
...

Now,

...
SELECT
          subq_25.ds__day AS metric_time__day
          , subq_25.user AS user
          , subq_25.visits AS visits
        FROM (
          -- Read Elements From Semantic Model 'visits_source'
          SELECT
            1 AS visits
...

@WilliamDee WilliamDee force-pushed the will/fix-conversion-window branch from 91d68b2 to 577bd26 Compare October 30, 2024 04:12
@WilliamDee WilliamDee force-pushed the will/fix-conversion-window branch from e1cc8f4 to fe18643 Compare October 30, 2024 21:00
@WilliamDee WilliamDee added the Reload Test Data in SQL Engines Should be run when test data changes label Oct 30, 2024
@WilliamDee WilliamDee temporarily deployed to DW_INTEGRATION_TESTS October 30, 2024 21:23 — with GitHub Actions Inactive
@WilliamDee WilliamDee temporarily deployed to DW_INTEGRATION_TESTS October 30, 2024 21:23 — with GitHub Actions Inactive
@WilliamDee WilliamDee temporarily deployed to DW_INTEGRATION_TESTS October 30, 2024 21:23 — with GitHub Actions Inactive
@WilliamDee WilliamDee temporarily deployed to DW_INTEGRATION_TESTS October 30, 2024 21:23 — with GitHub Actions Inactive
@github-actions github-actions bot removed the Reload Test Data in SQL Engines Should be run when test data changes label Oct 30, 2024
@WilliamDee WilliamDee added the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Oct 30, 2024
@WilliamDee WilliamDee temporarily deployed to DW_INTEGRATION_TESTS October 30, 2024 21:29 — with GitHub Actions Inactive
@WilliamDee WilliamDee temporarily deployed to DW_INTEGRATION_TESTS October 30, 2024 21:29 — with GitHub Actions Inactive
@WilliamDee WilliamDee temporarily deployed to DW_INTEGRATION_TESTS October 30, 2024 21:29 — with GitHub Actions Inactive
@WilliamDee WilliamDee temporarily deployed to DW_INTEGRATION_TESTS October 30, 2024 21:29 — 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 Oct 30, 2024
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.

Looks great!! 🚀

@WilliamDee WilliamDee merged commit 4cba912 into main Oct 31, 2024
43 checks passed
@WilliamDee WilliamDee deleted the will/fix-conversion-window branch October 31, 2024 17:58
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