diff --git a/core/dbt/task/list.py b/core/dbt/task/list.py index 85277e07b7e..19240321afa 100644 --- a/core/dbt/task/list.py +++ b/core/dbt/task/list.py @@ -8,8 +8,8 @@ from dbt.task.runnable import GraphRunnableTask, ManifestTask from dbt.task.test import TestSelector from dbt.node_types import NodeType -from dbt.exceptions import RuntimeException, InternalException -from dbt.logger import log_manager, GLOBAL_LOGGER as logger +from dbt.exceptions import RuntimeException, InternalException, warn_or_error +from dbt.logger import log_manager class ListTask(GraphRunnableTask): @@ -61,7 +61,7 @@ def _iterate_selected_nodes(self): spec = self.get_selection_spec() nodes = sorted(selector.get_selected(spec)) if not nodes: - logger.warning('No nodes selected!') + warn_or_error('No nodes selected!') return if self.manifest is None: raise InternalException( diff --git a/core/dbt/task/runnable.py b/core/dbt/task/runnable.py index 0e3c088b573..dd17c00e5b7 100644 --- a/core/dbt/task/runnable.py +++ b/core/dbt/task/runnable.py @@ -39,6 +39,7 @@ NotImplementedException, RuntimeException, FailFastException, + warn_or_error, ) from dbt.graph import ( @@ -438,8 +439,8 @@ def run(self): ) if len(self._flattened_nodes) == 0: - logger.warning("\nWARNING: Nothing to do. Try checking your model " - "configs and model specification args") + warn_or_error("\nWARNING: Nothing to do. Try checking your model " + "configs and model specification args") result = self.get_result( results=[], generated_at=datetime.utcnow(),