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] Meta is Missing in semantic_manifest.json #739

Closed
2 tasks done
HoseinBahmany opened this issue Aug 28, 2023 · 4 comments
Closed
2 tasks done

[Bug] Meta is Missing in semantic_manifest.json #739

HoseinBahmany opened this issue Aug 28, 2023 · 4 comments
Assignees
Labels
bug Something isn't working linear Todo

Comments

@HoseinBahmany
Copy link

HoseinBahmany commented Aug 28, 2023

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

Not sure whether this is a bug in the MetricFlow or dbt-core. Since this happens in the context of metadata for metric objects I thought it might be better to report it here.

I have two observations regarding the meta attribute:

  • Adding meta to a semantic_model would cause the following error:
    Invalid semantic_models config given in FilePath(..., 'meta': {'key1': 'value1'}} - at path []: Additional properties are not allowed ('meta' was unexpected)
    
    It seems the meta is not allowed on semantic_models
  • Adding meta to metrics would not cause any errors. But it would not appear in the semantic_manifest.json as well:
# metric definition in yml file
  - name: revenue
    description: Sum of the product revenue for each order item. Excludes tax.
    type: simple
    label: Revenue
    type_params:
      measure: revenue
    meta:
      owner: Jake

# relavent part of semantic_manifest.json
{
      "name": "revenue",
      "agg": "sum",
      "description": "The revenue generated for each order item. Revenue is calculated as a sum of revenue associated with each product in an order.",
      "create_metric": false,
      "expr": "product_price",
      "agg_params": null,
      "metadata": null,
      "non_additive_dimension": null,
      "agg_time_dimension": null
}

Expected Behavior

Based on the discussion it seems that meta should be supported on all dbt objects including the semantic_models and metrics

Steps To Reproduce

Simply add meta attribute to a semantic_model or a metric. I tested this on the jaffle_shop sample repo.

Relevant log output

No response

Environment

- OS: Window 10
- Python: 3.10
- dbt: 1.6.1
- metricflow: 0.201.0

Which database are you using?

postgres

Additional Context

No response

@QMalcolm
Copy link
Contributor

QMalcolm commented Aug 29, 2023

@HoseinBahmany I wanted to let you know that we are now tracking this in dbt-core (dbt-labs/dbt-core#8511). It's also worth noting that although it'll be specifiable, it likely will still not appear in the semantic_manifest.json. It will appear in the manifest.json though. Is there a specific use case you have that requires it to be in the semantic_manifest.json, or was that more so a debugging step?

@HoseinBahmany
Copy link
Author

Thank you @QMalcolm for the follow-up. I was trying to specify some metadata in my metric, like example usages, etc that would be helpful in my downstream visualization tools. I'm doing those in the description at the moment but it would make more sense to specify those in the metadata so my downstream tool can easily extract them.

In my downstream tool, I was parsing the semantic_manifest.json and thought I would find the metadata in there.

@Jstein77 Jstein77 added Todo linear and removed triage Tasks that need to be triaged backlog labels Aug 30, 2023
@Jstein77
Copy link
Contributor

This should be resolved with dbt-labs/dbt-core#8511

@alenaomal
Copy link

alenaomal commented Oct 31, 2024

Hi all! Really appreciate fixes related to this bug, thanks! But would like to return to the point that based on the dbt-labs/dbt-core#7456 meta should be supported in all dbt objects.
Currently it is supported in metrics, using 'meta', and in semantic_models, using 'config/meta'.
For my use cases it will be really helpful to have meta in entities, measures and dimensions as well.
Now i get same error for 'meta' and 'config/meta' properties.

- at path ['measures'][0]: Additional properties are not allowed ('meta' was unexpected)  
- at path ['measures'][0]: Additional properties are not allowed ('config' was unexpected)

UPD: new issue submitted - #1507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linear Todo
Projects
None yet
Development

No branches or pull requests

4 participants