Skip to content

Commit a52d1b7

Browse files
authored
Return code or error ignores WarnErrorOptions (#692)
Ignore `WarnErrorOptions` string in stdout from dbt-core, do not treat it as a failure Closes: #642
1 parent 0b538a5 commit a52d1b7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cosmos/dbt/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def run_command(command: list[str], tmp_dir: Path, env_vars: dict[str, str]) ->
8888
"Unable to run dbt ls command due to missing dbt_packages. Set RenderConfig.dbt_deps=True."
8989
)
9090

91-
if returncode or "Error" in stdout:
91+
if returncode or "Error" in stdout.replace("WarnErrorOptions", ""):
9292
details = stderr or stdout
9393
raise CosmosLoadDbtException(f"Unable to run {command} due to the error:\n{details}")
9494

tests/dbt/test_graph.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ def test_load_dbt_ls_and_manifest_with_model_version(load_method):
679679
"stdout,returncode",
680680
[
681681
("all good", None),
682+
("WarnErrorOptions", None),
682683
pytest.param("fail", 599, marks=pytest.mark.xfail(raises=CosmosLoadDbtException)),
683684
pytest.param("Error", None, marks=pytest.mark.xfail(raises=CosmosLoadDbtException)),
684685
],

0 commit comments

Comments
 (0)