From 2358fdb39fe81368417116df21779ff8baa425c4 Mon Sep 17 00:00:00 2001 From: adammarples Date: Mon, 20 Nov 2023 09:40:48 +0000 Subject: [PATCH 1/2] ignore WarnErrorOptions string --- cosmos/dbt/graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cosmos/dbt/graph.py b/cosmos/dbt/graph.py index 40154308b..556ebe09a 100644 --- a/cosmos/dbt/graph.py +++ b/cosmos/dbt/graph.py @@ -88,7 +88,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}") From c94ef6761c632af047caab3b1e88458c6d9e8da0 Mon Sep 17 00:00:00 2001 From: adammarples Date: Mon, 20 Nov 2023 09:42:39 +0000 Subject: [PATCH 2/2] add a test for WarnErrorOptions string passing if found in stdout --- tests/dbt/test_graph.py | 1 + 1 file changed, 1 insertion(+) 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)), ],