Hi team! I had a SourceAsset defined with metadata...
# ask-community
y
Hi team! I had a SourceAsset defined with metadata before
Copy code
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
Copy code
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
Copy code
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
I would expect that to work - this is in the
load_input
function? what version are you on?
y
right load_input function
dagster 1.1.5 I upgraded last week I think
s
oo wait - I think it should be
context.upstream_output.metadata.get("pillar_name")
D 1
context.metadata
will return metadata that you put on the
AssetIn
, not metadata from the upstream
y
oh! ok great
yeah actually it looks like it never worked before. I just had a work-around
thanks!