How do I define a method using dbt.cli that dynamically executes a dbt command? #21639
Answered
by
rexledesma
emilee-jurkowski
asked this question in
Q&A
-
We have defined dbt like so:
and are trying to dynamically trigger a dbt cli run with a sensor
The sensor will trigger a run, but end up with errors like the following. It's always the same error, sometimes it just displays a different dbt model name.
I have also tried |
Beta Was this translation helpful? Give feedback.
Answered by
rexledesma
May 7, 2024
Replies: 1 comment 5 replies
-
You should try setting - @op(required_resource_keys={"dbt"}, out=Out(Nothing))
+ @op(required_resource_keys={"dbt"}, out={})
def dbt_cli_op(context: OpExecutionContext, dbt_command: str, dbt_select: str, dbt_exclude: str=None):
dbt_cli_cmd = [dbt_command, "--select", dbt_select]
if dbt_exclude:
dbt_cli_cmd.extend(["--exclude", dbt_exclude])
yield from context.resources.dbt.cli(dbt_cli_cmd, manifest=dbt_manifest_path, dagster_dbt_translator=CustomDagsterDbtTranslator).stream() |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
emilee-jurkowski
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should try setting
out={}
.