Skip to content

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

@wtremml18

Description

@wtremml18

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

In the Semantic Layer, metrics that have a filter dependent on another metric are not included as part of the lineage graph.

Sample definition

  - name: ns_push_and_in_app_messaging
    description: ARR $ sending mobile push/in-app
    type: derived
    label: North Star for Push and In-App Messaging
    type_params:  
      expr: sum_ending_arr
      metrics:  
        - name: sum_ending_arr
          filter: |
            {{ Metric('sum_push_received', group_by=['klaviyo_account_id']) }} > 0

Rendered Lineage

Image

Expected Behavior

The filtered metric should be part of the lineage

Steps To Reproduce

  1. Create metric with a filter using a different source metric
  2. Run dbt docs

Relevant log output

N/A

Environment

- OS: MacOS 26.2
- Python: 3.13.2
- dbt: 1.12.0-a1 (hatch)
- snowflake 1.11.1

Which database adapter are you using with dbt?

snowflake

Additional Context

PR to come!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions