Son Giang
05/09/2022, 2:46 PMowen
05/09/2022, 5:31 PM# define some complex computation to produce an asset
@graph
def foo_asset():
x = regular_op(regular_op(...))
return create_foo_op(x)
my_asset_group = AssetGroup([AssetsDefinition.from_graph(foo_asset)])
sandy
05/09/2022, 7:57 PMSon Giang
05/10/2022, 2:05 AMSon Giang
05/10/2022, 2:07 AM# define some complex computation to produce an asset
@graph
def foo_asset():
x = op1()
y = asset1(x)
z = op2(y)
return asset2(z)
my_asset_group = AssetGroup([AssetsDefinition.from_graph(foo_asset)])
And can you provide the version of the release? Thank youSon Giang
05/10/2022, 7:32 AMbuild_job
function does not provide the config parameter.owen
05/10/2022, 9:03 PM@graph(out={"asset1": GraphOut(), "asset2": GraphOut()})
def foo_asset():
x = op1()
y = asset1(x)
z = op2(y)
return {"asset1": y, "asset2": asset2(z)}
owen
05/10/2022, 9:05 PMsandy
05/11/2022, 12:32 AM@op
def my_op(context):
assert context.partition_key == "a"
@graph
def my_graph():
return my_op()
assets_def = AssetsDefinition.from_graph(
graph_def=my_graph, partitions_def=StaticPartitionsDefinition(["a", "b", "c"])
)
AssetGroup([assets_def]).build_job("abc").execute_in_process(partition_key="a")