Skip to content

Conversation

@wtremml18
Copy link

Added node handling logic, test, and feature.

Resolves #12411

Problem

Semantic lineage previously ignored metrics that only appeared inside MetricFlow where filters (including Metric() expressions on measures, ratio components, or saved query clauses). Those filter-only references never surfaced as depends_on edges, so downstream manifests, docs, and governance tooling could not see that one metric relied on another through a filter.

Solution

  • Cache all custom granularity names on the manifest so MetricFlow filters can be parsed without rewalking time spines.
  • Parse every WhereFilterIntersection on metrics (top-level filters, measure filters, ratio/conversion/cumulative params, and nested input_metrics). Convert discovered metric calls into synthetic MetricInputs so they plug into the existing lineage builder.
  • Extend saved query parsing to inspect query_params.where for metric calls and add those targets to depends_on when they are only mentioned in filters.
  • Add regression tests for both metric lineage and saved queries to lock the behavior down.

Checklist

  • [x ] I have read the contributing guide and understand what's expected of me.
  • [x ] I have run this code in development, and it appears to resolve the stated issue.
  • [x ] This PR includes tests, or tests are not required or relevant for this PR.
  • [x ] This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • [x ] This PR includes type annotations for new and modified functions.

Added node handling logic, test, and feature.
@wtremml18 wtremml18 requested a review from a team as a code owner January 30, 2026 01:08
@cla-bot cla-bot bot added the cla:yes label Jan 30, 2026
@github-actions github-actions bot added the community This PR is from a community member label Jan 30, 2026
@wtremml18
Copy link
Author

cc: @plypaul - architecturally, I'm not sure if there's a better solution. This does resolve the issue of metrics as where filters not appearing in the lineage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:yes community This PR is from a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Semantic Layer "Metrics as Filters" do not appear in lineage

1 participant