-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
enhancementNew feature or requestNew feature or requestsemanticIssues related to the semantic layerIssues related to the semantic layer
Description
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
Tags specified for metrics are not reflected in parsed metric nodes in the following cases:
Case 1: +tags in dbt_project.yml
# dbt_project.yml
metrics:
my_project:
+tags:
- project_tagCase 2: tags in the metric's config: block (YAML)
# models/schema.yml
metrics:
- name: my_metric
label: "My Metric"
type: simple
type_params:
measure: my_measure
config:
tags:
- yaml_tagAfter dbt parse, neither project_tag nor yaml_tag appears in the metric's tags field in manifest.json.
This affects both v1 and v2 metrics:
- v1 (UnparsedMetric): only inline tags: at the metric top level are used; config.tags (from YAML or dbt_project.yml) are ignored.
- v2 (UnparsedMetricV2): tags are always initialized to []; all tag sources are ignored.
Expected Behavior
Tags should be applied to metrics from all sources, consistent with models and other nodes:
- config.tags in the YAML definition
- +tags in dbt_project.yml
- These should be merged with any inline tags: specified on the metric.
Steps To Reproduce
- Create a project with a metric.
- Add config: tags: [yaml_tag] to the metric in schema.yml, or add +tags: [project_tag] to dbt_project.yml under metrics:.
- Run dbt parse.
- Check target/manifest.json — the metric's tags field is empty.
Relevant log output
N/AEnvironment
- OS:
- Python:
- dbt:Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
dbt-athena
Root cause is in core/dbt/parser/schema_yaml_readers.py (MetricParser): the resolved config dict (containing merged tags from all sources) is computed but its tags value is never merged into the metric's tag list.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestsemanticIssues related to the semantic layerIssues related to the semantic layer