Bruno Almeida
07/14/2023, 11:43 AMZach
07/14/2023, 3:32 PMwith_resources
to tie the resources to the asset, then define the asset job using the resource-associated assets. Something like this:
from dagster import with_resources
@graph_asset()
def middle_asset():
return optimize_table_op(get_data_op(create_dataset_op()))
middle_asset_with_resources = with_resources([middle_asset], resource_defs={"db": my_db_resource})
middle_asset_schedule = ScheduleDefinition(
cron_schedule="* * * * *",
job=define_asset_job(
name="middle_asset_job",
selection=[middle_asset_with_resources]
)
)
I'm not sure if new ways to do it have been exposed recently though, I'm not as familiar with the new ConfigurableResource systemBruno Almeida
07/14/2023, 4:14 PM