Peter Lim
12/08/2022, 10:57 PMowen
12/08/2022, 10:58 PMruntime_metadata_fn
(https://docs.dagster.io/_apidocs/libraries/dagster-dbt#assets-dbt-core) sounds like what you're looking for herePeter Lim
12/08/2022, 11:00 PMowen
12/08/2022, 11:05 PMcontext
argument (that's the same thing that's passed into the context
argument of an asset), and the second is a dictionary of metadata parsed out of the manifest.json
file. So one example would be
def custom_metadata_fn(context, node_info):
table_name = node_info["name"]
table_schema = node_info["schema"]
n_rows = ... # query database
return {"n_rows": n_rows}
load_assets_from_dbt_manifest(..., runtime_metadata_fn=custom_metadata_fn)
Peter Lim
12/08/2022, 11:08 PM