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-2691] Populate MetricNode depends_on #7854

Closed
Tracked by #7498
QMalcolm opened this issue Jun 13, 2023 · 2 comments · Fixed by #8015
Closed
Tracked by #7498

[CT-2691] Populate MetricNode depends_on #7854

QMalcolm opened this issue Jun 13, 2023 · 2 comments · Fixed by #8015
Assignees
Labels
semantic Issues related to the semantic layer

Comments

@QMalcolm
Copy link
Contributor

No description provided.

@github-actions github-actions bot changed the title Populate MetricNode depends_on [CT-2691] Populate MetricNode depends_on Jun 13, 2023
@QMalcolm QMalcolm added the semantic Issues related to the semantic layer label Jun 16, 2023
@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 26, 2023

@QMalcolm Am I right in thinking that this would require dbt to traverse metricmeasuresemantic_model, so that we can record SemMod unique IDs in the metric's depends_on.nodes?

A metric's filter can also depend on a dimension from a semantic model that is different from the semantic model it depends on via its measure.

I think this would be a prerequisite for DAG relationships to work:

@QMalcolm
Copy link
Contributor Author

QMalcolm commented Jul 5, 2023

I chatted with @jtcohen6 earlier. There are three-ish places that metrics need to source the nodes for it's depends_on attribute

  1. Metric.type_params.input_metrics for RATIO and DERIVED type metrics
  2. Metric.type_params.measure for SIMPLE and CUMULATIVE type metrics
  3. From filters
    a. Metric.filter
    b. Metric.type_params.measure.filter
    c. Metric.type_params.input_metrics[x].filter

The work for 1 and 2 exist currently on #8015.

Number 3 is a bit harder though. This is because
A. The spec for filters actually isn't finalized yet. The MetricFlow team is working on support for dunders
B. Which semantic model a dimension comes from in a filter is determined at query time (because a dimension can exist on multiple semantic models and the optimal join path is calculated).

Thus this issue is just to resolve 1 & 2, whereas 3 will be pushed off and become a separate core ticket/issue

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants