Sean Davis
06/14/2022, 8:33 PM@asset
decorator since it nicely aligns with my use case. How does one add assets (or the ability to materialize them) or jobs built with AssetGroup.build_job
to a repository? At a slightly higher level, Software Defined Assets are really cool, but it does feel like they aren't quite fully integrated. Should I simply avoid them for the time being?claire
06/14/2022, 9:19 PM@asset
def my_asset():
pass
@repository
def my_repo():
return [my_asset]
Sean Davis
06/14/2022, 9:54 PMclaire
06/14/2022, 9:58 PMdpad
06/16/2022, 4:07 AMAssetGroup.build_job()
, but I understand this is now deprecated in favour of define_asset_job()
. However, I can't execute the job created by define_asset_job()
directly because it seems to only become defined when attached to a repository? Is there no way to programmatically run jobs anymore without defining a repository of jobs upfront?dpad
06/16/2022, 4:10 AMUnresolvedAssetJobDefinition.resolve()
function that I can use directly by just passing the list of assets, so I can bypass having a repository. Including this here in case anyone else runs into this same question!claire
06/16/2022, 4:11 AMdpad
06/16/2022, 4:13 AMdpad
06/16/2022, 4:13 AMexecute_in_process
defaults to fs_io_manager
instead of mem_io_manager
like is stated on the IO Managers page... 😛dpad
06/16/2022, 5:25 AMwith_resources()
adds the "fs_io_manager" to the resource. This doesn't match the "default_job_io_manager" so it doesn't get swapped automatically in _swap_default_io_man()
. I don't know whether this is intended but thought I'd let you know. I guess for now I just need to specify the IO manager manually.dpad
06/16/2022, 5:25 AMexecute_in_process()
should swap automatically to "mem_io_manager", but this doesn't happen if you build a job using with_resources()
.)claire
06/16/2022, 6:34 AMexecute_in_process
with fs_io_manager
allows materializations to be persisted and viewable in tests. We do however have another method that allows you to materialize to memory for testing purposes, if that is your preferred behavior: https://docs.dagster.io/_apidocs/execution#dagster.materialize_to_memorydpad
06/16/2022, 7:30 AMdpad
06/16/2022, 7:31 AMclaire
06/16/2022, 5:13 PMmaterialize_to_memory
accepts a list of assets definitions. No problem, happy to help!