Drew You
05/11/2023, 6:45 PMmetadataEntries
are empty for all of my asssets.
example query:
query RepositoriesQuery {
repositoriesOrError {
... on RepositoryConnection {
nodes {
name
assetNodes{
assetKey {
path
}
metadataEntries {
label
description
}
...
response has metadataEntires:[]
for all assets despite seeing metadata in dagit.sean
05/11/2023, 6:47 PMDefinitions
object with one asset with metadata that is displaying this behavior.Drew You
05/11/2023, 6:55 PMcontext.add_output_metadata()
in the io-manager
and none of them have metadataEntries
sean
05/11/2023, 7:19 PMcontext.add_output_metadata
does not add metadata to the assets definition. That puts metadata on the AssetMaterialization
event. The metadata on the definition, which is what you’re querying in that GQL query, is set like this (also an example of a simple example of the kind I’m talking about):
from dagster import asset, Definitions
@asset(metadata={"foo": "bar"})
def foo_asset():
return 1
defs = Definitions(
assets=[foo_asset]
)
Put that in a file and run dagster dev -f path/to/file
and your query should return the correct metadata.Drew You
05/11/2023, 7:59 PMsean
05/11/2023, 9:29 PMAssetsDefinition
objects are basically wrappers around ops. They are a unit for buliding your data pipelines. They are defined when you load the code location, along with ops, jobs etc. They are not changed by Dagster runs.
What is generated by runs are events. An AssetMaterialization
is a kind of event, generated every time an asset’s materialization function is run. You modify the materialization generated by the current run when you use add_output_metadata
.Drew You
05/15/2023, 1:19 PMassetMaterializations {
timestamp
metadataEntries {
label
description
}
partition
}
I'm getting the correct labels but all of the description
fields are None
in the graphql response despite being populated in the dagit ui?graphql
front-end (as well as from a python gql request):
"path": [
"funding_rates_and_info"
]
},
"assetMaterializations": [
{
"timestamp": "1684156958695",
"metadataEntries": [
{
"label": "uri",
"description": null
}
],
"partition": null
},
{
"timestamp": "1683830321403",
"metadataEntries": [
{
"label": "path",
"description": null
}
],
"partition": null
}
],