Dmitry Mogilevsky
06/16/2022, 7:27 PMfrom_graph
and have that asset accept op configs? Or, as an alternative question, what's the right process for providing input variables that are used persistently throughout the graph? My previous use pattern was to define very simple ops that took a config and returned its value and then pass these ops as inputs. What's the correct pattern in asset world? Thanks for your patience with all my questions.claire
06/16/2022, 8:42 PM@op(config_schema=int)
def op_one(context):
assert context.op_config == 1
return context.op_config
@op(config_schema=int)
def op_two(context, op_one):
assert context.op_config == 2
return context.op_config + op_one
@graph
def my_graph():
return op_two(op_one())
materialize_to_memory(
[AssetsDefinition.from_graph(my_graph)],
run_config={"ops": {"my_graph": {"ops": {"op_one": {"config": 1}, "op_two": {"config": 2}}}}},
)
sandy
06/16/2022, 11:02 PM