Open saurabh0402 opened 1 month ago
Hey @tlento, can you please check this one?
I can try picking this up if it's a bug. If not, please let me know how I can get the metadata
field to work?
MetricFlow itself has no notion of a meta
field, and as such it won't appear in the semantic_manifest.json. You can see that the protocol we use for metrics doesn't include it.
The metadata
field you see in semantic_manifest.json is actually an internal construct for allowing us to produce pointers to locations in the user-defined semantic manifest configuration for where validation errors are discovered. I'm not fundamentally opposed to putting the dbt meta
in there but I think it's probably better if we figure out a way to more cleanly separate user-land arbitrary key/value pairs from system-supplied entries. I'm pretty sure there was an issue open to support this, but it hasn't been a priority for us.
As for the dbt output, the dbt core parser should be taking the raw meta
field parsed out of the YAML and passing it straight into the metric object it includes in the manifest, which should in turn be serialized inside of the manifest.json.
If this isn't happening that suggests a bug in the core parser.
I think your options are:
meta
attributes you care about. If they aren't appearing that is a bug, and you should open an issue in dbt-core so we can get it fixed.
Is this a new bug in metricflow?
Current Behavior
Scavaging through the documentation, we found two ways of adding
metadata
for metricsmeta
can be defined at the top-level with a metric. So, something like the followingmeta
can be added inside theconfig
object. So, something like the followingWe tried both syntaxes. But when
dbt compile
is run, neither thesemantic_manifest.json
nor theoutput.json
has the value added to themetadata
field. As a result, runningmetricFlowEngine.list_metrics()
also does not return any metadata.Expected Behavior
The value should be added to the
metadata
field. So, thesemantic_manifest.json
should have the following.And
metricFlowEngine.list_metrics()
should return the value inmetadata
field as well.Steps To Reproduce
meta
fielddbt compile
and then check thesemantic_manifest.json
or runmetricFlowEngine.list_metrics()
.metadata
field.Relevant log output
No response
Environment
Which database are you using?
snowflake
Additional Context
No response