diff --git a/cosmos/dbt/graph.py b/cosmos/dbt/graph.py index f3ea63e7e8..db6e75aa8d 100644 --- a/cosmos/dbt/graph.py +++ b/cosmos/dbt/graph.py @@ -102,10 +102,7 @@ def load( if self.project.is_manifest_available(): self.load_from_dbt_manifest() return - elif ( - execution_mode in (ExecutionMode.LOCAL, ExecutionMode.VIRTUALENV) - and self.project.is_profile_yml_available() - ): + elif execution_mode == ExecutionMode.LOCAL and self.project.is_profile_yml_available(): try: self.load_via_dbt_ls() return diff --git a/tests/dbt/test_graph.py b/tests/dbt/test_graph.py index c210fe1dfc..5b4b8fbd5f 100644 --- a/tests/dbt/test_graph.py +++ b/tests/dbt/test_graph.py @@ -87,7 +87,7 @@ def test_load_manifest_with_manifest(mock_load_from_dbt_manifest): "exec_mode,method,expected_function", [ (ExecutionMode.LOCAL, LoadMode.AUTOMATIC, "mock_load_via_dbt_ls"), - (ExecutionMode.VIRTUALENV, LoadMode.AUTOMATIC, "mock_load_via_dbt_ls"), + (ExecutionMode.VIRTUALENV, LoadMode.AUTOMATIC, "mock_load_via_custom_parser"), (ExecutionMode.KUBERNETES, LoadMode.AUTOMATIC, "mock_load_via_custom_parser"), (ExecutionMode.DOCKER, LoadMode.AUTOMATIC, "mock_load_via_custom_parser"), (ExecutionMode.LOCAL, LoadMode.DBT_LS, "mock_load_via_dbt_ls"),