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

[CT-1352] Metric SQL generation breaks with dbt-core 1.3.0 #323

Closed
popeliam opened this issue Oct 15, 2022 · 2 comments · Fixed by #346
Closed

[CT-1352] Metric SQL generation breaks with dbt-core 1.3.0 #323

popeliam opened this issue Oct 15, 2022 · 2 comments · Fixed by #346
Labels
bug Something isn't working

Comments

@popeliam
Copy link

Describe the bug

After the dbt-core 1.3.0 release with the new v7 manifest, dbt-docs is no longer generating the correct SQL for metrics. When viewing the code section of metrics, the first line is always compiled as

select undefined(undefined)

I think the problem is that some of the metrics attributes/attribute values were renamed, specifically sql -> expression, type -> calculation_method, and type: expression -> calculation_method: derived.

In dbt-docs the metric SQL generator contains logic that still uses the sql, type, and type: expression attributes. Since sql and type are no longer defined they just get compiled as undefined.

1.3.0 did retain backwards compatibility but it did so by replacing the attributes during parsing and not retaining the old ones. This means that when using the old attribute names in a 1.3.0 project the dbt docs site still compiles as undefined(undefined)

Steps To Reproduce

dbt docs generate && dbt docs serve in a 1.3.0 dbt project that contains metrics with either the new or old attribute names.

Expected behavior

When I define metrics in a dbt 1.3.0 project, the SQL in their Code section should be compiled properly.

Screenshots and log output

image

The output of dbt --version:

Core:
  - installed: 1.3.0
  - latest:    1.3.0 - Up to date!

Plugins:
  - bigquery: 1.3.0 - Up to date!

Additional context

Add any other context about the problem here.

@popeliam popeliam added bug Something isn't working triage labels Oct 15, 2022
@github-actions github-actions bot changed the title Metric SQL generation breaks with dbt-core 1.3.0 [CT-1352] Metric SQL generation breaks with dbt-core 1.3.0 Oct 15, 2022
@jtcohen6
Copy link
Contributor

@popeliam Thanks for opening! You're quite right. Let's get this fixed, and slated for a v1.3.1 patch release.

@popeliam
Copy link
Author

@jtcohen6 Sure thing, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants