Tom Reilly
05/18/2023, 6:31 PM@graph
def snowflake_table():
method_1_load, method_2_load = branching_op()
method_1_op(method_1_load)
method_2_op(method_2_load)
is there a way to resolve this to a single output? We frequently create table assets using AssetsDefinition.from_graph()
and would like to use conditional branching to determine which load method to use. Regardless of which method is used the output is a materialized table. We name the asset by specifying a value for 'result'
in keys_by_output_name
snowflake_table_asset = AssetsDefinition.from_graph(
snowflake_table,
keys_by_output_name={
"result": AssetKey("specific_table_name"),
}
)
but when branching is involved this leads to errors like
The set of output names keys specified in the keys_by_output_name argument must equal the set of asset keys outputted
Tom Reilly
05/18/2023, 6:33 PM