Ivan Tsarev
05/17/2023, 12:38 PMdagster_dbt.dbt_cloud_run_op
?
My case is kinda basic, I have two environment for dagster and one dbt Cloud project.
Dbt manages prod/dev DWH separation by itself by target mechanism - when it is defined as "prod" in Jobs it will use prod DWH, in any other cases it will fall to dev DWH. So we do have target set as "prod" in most of our jobs to use it as prod way to work with DWH.
However, we are now switching to dagster for orchestration of dbt and for sure we want more or less same functionality with prod/test.
And I figured out 2 and a half workout right now:
• Have two different sets of Jobs in dbt. One to be started from prod Dagster and another from dev. To be honest it sounds awful and is terrible in terms of scalability with number of dbt Jobs.
• Defining our own ops based on DbtCloudClient
but I not quite sure how stable this api is especially with this comment in source code:
# TODO: This resource should be a wrapper over an existing client for a accessing dbt Cloud,
# rather than using requests to the API directly.
• Making PR to dagster adding this functionality which is probably ideal but definitely not as quick as I want :)
So any other ideas?Qwame
05/17/2023, 2:27 PMDbtCloudClient
accepts all arguments that can be passed when using the Dbt API. dbt.get_dbt_client().run_job_and_poll
should give you all that. You can pass target_override
, etc. and all arguments you can pass to the dbt cloud API hereIvan Tsarev
05/17/2023, 2:34 PMQwame
05/17/2023, 2:47 PMIvan Tsarev
05/17/2023, 2:48 PMQwame
05/17/2023, 3:14 PMrun_job_and_poll
for your needs and later migrate if these changes are integrated.