https://dagster.io/ logo
Title
y

Yang

12/12/2022, 11:54 PM
Hi team! I had a SourceAsset defined with metadata before
g_pillar_name = SourceAsset(
    key=AssetKey("g_pillar_name"),
    io_manager_key="pillar_name_io",
    metadata={"pillar_name": "governance"})
Then in the io_manager I would reference it
context.metadata.get("pillar_name")
Does this not work? I swear it worked before. Thanks!
for more context, I'm setting the input to be the source asset in the job from_graph
g_metrics = AssetsDefinition.from_graph(
    pillar_metrics_scores,
    keys_by_input_name={
        "pillar_name": AssetKey("g_pillar_name")},
    keys_by_output_name={
        "result": AssetKey("g_metrics_scores")},
    partitions_def=year_dataset_context_def)
s

sandy

12/13/2022, 12:31 AM
I would expect that to work - this is in the
load_input
function? what version are you on?
y

Yang

12/13/2022, 1:03 AM
right load_input function
dagster 1.1.5 I upgraded last week I think
s

sandy

12/13/2022, 5:34 PM
oo wait - I think it should be
context.upstream_output.metadata.get("pillar_name")
:dagster: 1
context.metadata
will return metadata that you put on the
AssetIn
, not metadata from the upstream
y

Yang

12/13/2022, 5:54 PM
oh! ok great
yeah actually it looks like it never worked before. I just had a work-around
thanks!