https://dagster.io/ logo
Title
s

Saul Burgos

02/17/2023, 4:24 PM
How can I run the "job" created by "define_asset_job" using the python API ? Is there something like "UnresolvedAssetJobDefinition" for this object My use case is: I have a lot of "define_asset_job" and want to executed by python code in a certain order by my own rules
I am trying to do this:
asset3_job = define_asset_job(name="lulu_test3", selection=dbt_assets)
new_job = asset3_job.resolve()
new_job.execute_in_process()
But I am getting this error
o

owen

02/17/2023, 5:55 PM
if you're using Definitions, you'll want to do
defs = Definitions(...)

defs.get_job_def("lulul_test3").execute_in_process()
essentially, an UnresolvedAssetJob cannot be resolved outside the broader context of a set of Definitions (or RepositoryDefinition), as the asset selection you pass into it needs to be resolved against the set of assets in the repo/defs
❤️ 1
j

Jeff Nawrocki

02/17/2023, 6:02 PM
Awesome, that did the trick. Thanks!