Jeremy
06/06/2023, 3:59 PM@op(required_resources={"file_system"})
def read_files(context):
...
first_dataset = AssetsDefinition.from_op(read_files)
second_dataset = AssetsDefinition.from_op(read_files)
where I want to be able to define the "file_system"
resource for each of the two assets.
I've tried config_mapping
with and without jobs
, with_resource
but it seems only the resource defined in Definition
is used.
Maybe my implementaiton is wrong or maybe I've got entirely the wrong approach. Any suggestions would be appreciated.sandy
06/06/2023, 4:31 PMdef make_dataset_asset(name, file_system_resource_key):
@asset(name=name, required_resource_keys={file_system_resource_key})
def _asset(context):
...
return _asset
first_dataset = make_dataset_asset("asset1", "fs1")
second_dataset = make_dataset_asset("asset2", "fs2")
Jeremy
06/06/2023, 5:06 PM