diff --git a/cosmos/dbt/graph.py b/cosmos/dbt/graph.py index f154496e5..eb8ef19a5 100644 --- a/cosmos/dbt/graph.py +++ b/cosmos/dbt/graph.py @@ -115,7 +115,7 @@ def run_command(command: list[str], tmp_dir: Path, env_vars: dict[str, str]) -> "Unable to run dbt ls command due to missing dbt_packages. Set RenderConfig.dbt_deps=True." ) - if returncode or "Error" in stdout: + if returncode or "Error" in stdout.replace("WarnErrorOptions", ""): details = stderr or stdout raise CosmosLoadDbtException(f"Unable to run {command} due to the error:\n{details}") diff --git a/tests/dbt/test_graph.py b/tests/dbt/test_graph.py index 3e3218259..224aff56e 100644 --- a/tests/dbt/test_graph.py +++ b/tests/dbt/test_graph.py @@ -679,6 +679,7 @@ def test_load_dbt_ls_and_manifest_with_model_version(load_method): "stdout,returncode", [ ("all good", None), + ("WarnErrorOptions", None), pytest.param("fail", 599, marks=pytest.mark.xfail(raises=CosmosLoadDbtException)), pytest.param("Error", None, marks=pytest.mark.xfail(raises=CosmosLoadDbtException)), ],