How can I create a job from an op and a `define_as...
# ask-community
How can I create a job from an op and a
? I have
build = define_asset_job(...)
@job def deploy(): clone_db()
(where clone_db is an op). I want
@job def build_and_deploy(): deploy(build())
. But this doesn't work because build is not callable (it's an UnresolvedAssetJobDefinition not a function). How can I achieve the desired result?
I don't think you can string together asset jobs and op-based jobs. The options I can think of for bridging the two would be 1) refactoring to two graph-based assets and then creating one asset job to encapsulate both of them or 2) using an AssetMaterializationSensor or RunStatusSensor to kick off a job when the asset job finishes
+1 to what Zach said. Any particular reason not to model
as an asset?
Hey guys. I think you're right that
should probably be another asset. That will just require a bit of a mental shift from myself– I hadn't thought of that! Thanks for your help 🙂