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

[Regression] Changes from Meta/Tags to Config properties in semantic_model.yml/semantic_models lead to NULLs in Discovery API query result #1508

Open
2 tasks done
alenaomal opened this issue Nov 5, 2024 · 0 comments
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 regression in a recent version of metricflow?

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

Current Behavior

Hi all! I understand, that this part can be slightly related to metricflow, but I believe that resolution of the following issue leads to the current state.
I have semantic_model.yml file with described model and other attributes (just part of it below)

semantic_models:
  - name: my_model
    config:
      meta:
        whatever_key: whatever_value
      tags: ["role_developer", "type_test"]
    defaults:
      agg_time_dimension: updated_datetime
    description: some description
    model: ref('sl_my_model')

and I want to get meta or tags or whatever using Discovery API.
There is possibility to add meta and tags to API query. But the result is empty. And there is no possibility to add config to query instead. (using https://ye912.metadata.us1.dbt.com/graphql)

image

{
 "data": {
   "environment": {
     "definition": {
       "semanticModels": {
         "edges": [
           {
             "node": {
               "name": "my_model",
               "meta": null,
               "tags": [],
               "description": "some description"
             }
           }
         ]
       }
     }
   }
 }
}

Expected/Previous Behavior

Discovery API can return all attributes from config property for semantic_models.

Steps To Reproduce

Way 1.
Go to https://ye912.metadata.us1.dbt.com/graphql and make sure that there is no property config in API.
Meta and Tags exist in API but they cannot be added directly to yml file, an error occured during validation.

  1. Add meta property to semantic_models
semantic_models:
  - name: my_model
    meta:
      test: test
    ....
  1. Run dbt parse
  2. Get an error
    Invalid semantic_models config given in FilePath(searched_path='models', relative_path='semantic_models\\my_model.yml', ... - at path []: Additional properties are not allowed ('meta' was unexpected) - if I can't add them to yml, I can't query via API

Way 2.

  1. In semantic_model.yml file add property config with meta and/or tags attributes.
semantic_models:
  - name: my_model
    config:
      meta:
        whatever_key: whatever_value
      tags: ["role_developer", "type_test"]
    ....
  1. Use the following query to get meta and tags from yml using https://ye912.metadata.us1.dbt.com/graphql. (add appropriate environmentId and first variables)
query SemanticModels($environmentId: BigInt!, $first: Int) {
  environment(id: $environmentId) {
    definition {
      semanticModels(first: $first) {
        edges {
          node {
            name
            meta
            tags
            description
          }
        }
      }
    }
  }
}
  1. Check empty result
{
 "data": {
   "environment": {
     "definition": {
       "semanticModels": {
         "edges": [
           {
             "node": {
               "name": "my_model",
               "meta": null,
               "tags": [],
               "description": "some description"
             }
           }
         ]
       }
     }
   }
 }
}

Relevant log output

No response

Environment

- OS: Windows 10
- Python: 3.10.8
- dbt-metricflow: 0.7.1
- metricflow (working version): 0.206.0
- metricflow (regression version): -

Which database adapter are you using with metricflow?

bigquery

Additional Context

No response

@alenaomal alenaomal added bug Something isn't working triage Tasks that need to be triaged labels Nov 5, 2024
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

1 participant