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

[Feature] Support the basic dbt 1.6 metric #870

Merged
merged 9 commits into from
Sep 1, 2023

Conversation

wcchang1115
Copy link
Contributor

PR checklist

  • Ensure you have added or ran the appropriate tests for your PR.
  • DCO signed

What type of PR is this?
feature

What this PR does / why we need it:

  • Because dbt 1.6 introduced the new dbt metric, it's the update to support new metric query.

Which issue(s) this PR fixes:
sc-32064

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

wcchang1115 and others added 8 commits August 31, 2023 17:28
Co-authored-by: wcchang <[email protected]>
Signed-off-by: popcorny <[email protected]>
Signed-off-by: Wei-Chun, Chang <[email protected]>
Signed-off-by: Wei-Chun, Chang <[email protected]>
Signed-off-by: Wei-Chun, Chang <[email protected]>
Signed-off-by: Wei-Chun, Chang <[email protected]>
@wcchang1115 wcchang1115 changed the title [Feature] Support the basic dbt 16 metric [Feature] Support the basic dbt 1.6 metric Sep 1, 2023
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #870 (c230321) into main (f16c52c) will increase coverage by 0.08%.
The diff coverage is 72.19%.

@@            Coverage Diff             @@
##             main     #870      +/-   ##
==========================================
+ Coverage   47.83%   47.92%   +0.08%     
==========================================
  Files          71       71              
  Lines       10021    10189     +168     
==========================================
+ Hits         4794     4883      +89     
- Misses       5227     5306      +79     
Files Changed Coverage Δ
piperider_cli/runner.py 54.26% <25.00%> (-0.47%) ⬇️
piperider_cli/metrics_engine/metrics.py 23.71% <50.00%> (+1.94%) ⬆️
piperider_cli/dbtutil.py 67.72% <75.44%> (-7.43%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wcchang1115 wcchang1115 marked this pull request as ready for review September 1, 2023 08:01
piperider_cli/__init__.py Outdated Show resolved Hide resolved

m = Metric(metric.get('name'),
calculation_method='derived',
expression=f"{numerator.get('name')} / {denominator.get('name')}",
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Would be better to pass the calculation_method & numerator & denominator to Metric object. Then generate the SQL accordingly. But now, it is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will put it into another story to enhance

@wcchang1115 wcchang1115 merged commit 50dc6b7 into main Sep 1, 2023
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants