Conditionally Run DbtAsset Materialization from an Asset #25472
Unanswered
rover-wagnar
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I'm working on a data pipeline that needs to run monthly. It also needs to be resilient so in the case of failures or cancellations it can be re-run without reprocessing a large amount of data. To accomplish this, I'm using an S3 state file to track the processing of the data as it gets processed in batches.
At the beginning of this pipeline I want to run a DBT snapshot from a
dbt_asset
, but ONLY the first time the job runs (so if it was killed or stopped and re-run, it would not run the snapshot again). I tried following the advice around yielding MaterializeResult in discussion 19632, but this did not seem to work. This seemed to run but not actually trigger the snapshot to run.What I would like ideally is to have the pipeline trigger a DBT snapshot run and then wait for the snapshot to finish. Is there a way to conditionally run a
dbt_asset
from a normalasset
and wait for thedbt_asset
process to complete?Here's some of the code for the pipeline:
dbt_asset - correctly selects the dbt snapshot
multi_asset - conditionally runs the dbt_asset
Beta Was this translation helpful? Give feedback.
All reactions