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-2526] Create Metric node for measures with create_metric: true during parsing #7504

Closed
Tracked by #8125
QMalcolm opened this issue May 3, 2023 · 1 comment · Fixed by #8310
Closed
Tracked by #8125
Assignees
Labels
semantic Issues related to the semantic layer user docs [docs.getdbt.com] Needs better documentation

Comments

@QMalcolm
Copy link
Contributor

QMalcolm commented May 3, 2023

SemanticModels have Measure sub-objects. Measures can be defined with create_metric: true. If a Measure is defined with this, we need to create a Metric node for the Measure during parse time. We do have a prototype of one way this could be done, #7187, if inspiration is needed.

Blocked by:

@QMalcolm QMalcolm added this to the v1.6 milestone May 3, 2023
@github-actions github-actions bot changed the title Create Metric node for measures with create_metric: true during parsing [CT-2526] Create Metric node for measures with create_metric: true during parsing May 3, 2023
@jtcohen6
Copy link
Contributor

jtcohen6 commented May 8, 2023

There's an analogy here for models & generic tests

Model

  • columns (attribute of Model node)
    • tests --> creates Test nodes

SemanticModel

  • measures (attribute of SemanticModel)
    • create_metric --> creates full-fledged Metric nodes

There are some simple rules for copying over the measure's attributes into the new Metric node

For partial parsing: We always need to schedule metrics for re-parsing if there is a change to one or multiple SemanticModels that the metric depends on. This holds true for metrics defined explicitly, and implicitly via create_metric: true.

@jtcohen6 jtcohen6 removed this from the v1.6 milestone May 26, 2023
@QMalcolm QMalcolm added semantic Issues related to the semantic layer and removed MetricFlow labels Jul 18, 2023
@jtcohen6 jtcohen6 added the user docs [docs.getdbt.com] Needs better documentation label Aug 31, 2023
@jtcohen6 jtcohen6 added user docs [docs.getdbt.com] Needs better documentation and removed user docs [docs.getdbt.com] Needs better documentation labels Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semantic Issues related to the semantic layer user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants