https://dagster.io/ logo
#ask-community
Title
# ask-community
d

Dmytro Lukash

07/03/2023, 8:51 AM
Hi! I have an asset, constructed with
AssetsDefinition.from_graph()
. One of Op inside the graph using custome IO manager. I want to add some tags to all this setup and only graph and Op posses this functionality. The question is - Is there any option how to get graph's tags inside IOManagers
handle_output
method?
🤖 1
j

jamie

07/03/2023, 4:25 PM
Hey @Dmytro Lukash I think you should be able to get the tags via
context.op_def.tags
as long as the tags are added as part of the op definition ie
Copy code
@op(
   tags={"foo": "bar"}
)
def my_op():
   ...
d

Dmytro Lukash

07/03/2023, 4:50 PM
Well yeah. I am able to get op's tags. But my goal is to get tags from graph
Copy code
@op(
    tags={"op_tag":"op_tag_value"}
)
def op:
    ...
    
@graph(
    tags={"graph_tag":"graph_tag_value"}
)
def graph:
    ...
j

jamie

07/03/2023, 4:55 PM
ah i see. I poked around the context a bit and i dont think this is currently possible. the context in the handle_output method is scoped for the output of the op, so info about the surrounding graph isn’t available
d

Dmytro Lukash

07/03/2023, 4:59 PM
Ok! Thank for clarification! I'm really appreciate.