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

[Bug] dbt-core properties are not supported in semantic_model.yml and Discovery API #1507

Open
2 tasks done
alenaomal opened this issue Nov 5, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working triage Tasks that need to be triaged

Comments

@alenaomal
Copy link

alenaomal commented Nov 5, 2024

Is this a new bug in metricflow?

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

Current Behavior

There was issue previously, but it was not fully solved.
Meta and Tags are not supported in entities, measures, dimensions, but looks like should as per discussion.
An error occured
Invalid semantic_models config given in FilePath ... at path ['<entity_name>'][<seq_number>]: Additional properties are not allowed ('<property_name>' was unexpected)
example
Invalid semantic_models config given in FilePath ... at path ['entities'][0]: Additional properties are not allowed ('tags' was unexpected)
For comparison:
semantic_models part supports config, and meta and tags can be added there (config was resolution of issue mentioned above).
metrics part supports meta and tags as expected.
Moreover, these properties are absent in Discovery API (https://ye912.metadata.us1.dbt.com/graphql) (measure example on the screenshot). (separate feature can be submitted if it was done intentionally)
image

Expected Behavior

User is able to use Meta and Tags in semantic_model.yml (entities, measures, dimensions) and accessible via Discovery API.

semantic_models:
  - name: transaction
    model: ref('fact_transaction')
    description: "Our transaction semantic_model. Config supported for semantic_models instead of meta. Meta and tags can be 
 added there"
    default:
        agg_time_dimension: transaction_date
    config:
       meta:
         whatever_key: whatever_value

    entities:
      - name: transaction
        type: primary
        expr: transaction_id
        meta: 
           whatever_key: whatever_value
        tags: ["dev"]

    dimensions:
      - name: transaction_date
        type: time
        type_params:
            time_granularity: day
        meta: 
           whatever_key: whatever_value
        tags: ["dev"]

    measures:
      - name: transaction_total
        description: "The total value of the transaction"
        agg: sum
        meta: 
           whatever_key: whatever_value
        tags: ["dev"]

metrics:
  - name: revenue
    description: "some description. Meta and tags supported for metrics"
    meta: 
       whatever_key: whatever_value
    tags: ["dev"]
    type: simple
    type_params:
        measure: transaction_total

Steps To Reproduce

  1. Add Meta or Tags properties to entities, measures or dimensions to semantic_model.yml
  2. Run dbt parse
  3. Get an error
    Invalid semantic_models config given in FilePath ... at path ['<entity_name>'][<seq_number>]: Additional properties are not allowed ('<property_name>' was unexpected)
    example
    Invalid semantic_models config given in FilePath ... at path ['entities'][0]: Additional properties are not allowed ('tags' was unexpected)

Relevant log output

No response

Environment

- OS: Windows 11
- Python: 3.10.8
- dbt: 1.8.100
- metricflow: 0.206.0
- dbt-metricflow: 0.7.1

Which database are you using?

bigquery

Additional Context

No response

@alenaomal alenaomal added bug Something isn't working triage Tasks that need to be triaged labels Nov 5, 2024
@siljamardla
Copy link

Adding a bit of context.

For many measures, it would be convenient to add the create_metric: true configuration.
Because measures do not support meta or tags, we can't add them to measures. So to add these, we would still have to code out the metric itself, which is very work-intensive and not DRY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Tasks that need to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants