From 04ebdbb00b36ee6ddbbd2a909cfd43c4aa4724cf Mon Sep 17 00:00:00 2001 From: Jacob Beck Date: Thu, 30 Jan 2020 21:15:44 -0700 Subject: [PATCH] PR feedback --- core/dbt/contracts/graph/manifest.py | 12 +++++------- core/dbt/exceptions.py | 2 +- core/dbt/parser/util.py | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/dbt/contracts/graph/manifest.py b/core/dbt/contracts/graph/manifest.py index 8ec31ffe78f..6d95455e98f 100644 --- a/core/dbt/contracts/graph/manifest.py +++ b/core/dbt/contracts/graph/manifest.py @@ -20,7 +20,8 @@ from dbt.contracts.graph.compiled import CompileResultNode from dbt.contracts.util import Writable, Replaceable from dbt.exceptions import ( - raise_duplicate_resource_name, InternalException, raise_compiler_error + raise_duplicate_resource_name, InternalException, raise_compiler_error, + warn_or_error ) from dbt.include.global_project import PACKAGES from dbt.logger import GLOBAL_LOGGER as logger @@ -593,14 +594,11 @@ def patch_macros( continue macro.patch(patch) - # log debug-level warning about nodes we couldn't find if patches: for patch in patches.values(): - # since patches aren't nodes, we can't use the existing - # target_not_found warning - logger.debug(( - 'WARNING: Found documentation for macro "{}" which was ' - 'not found or is disabled').format(patch.name) + warn_or_error( + f'WARNING: Found documentation for macro "{patch.name}" ' + f'which was not found' ) def patch_nodes( diff --git a/core/dbt/exceptions.py b/core/dbt/exceptions.py index e53db9c1650..73a23ae8a47 100644 --- a/core/dbt/exceptions.py +++ b/core/dbt/exceptions.py @@ -727,7 +727,7 @@ def raise_duplicate_macro_patch_name(patch_1, patch_2): raise_compiler_error( f'dbt found two schema.yml entries for the same macro in package ' f'{package_name} named {name}. Macros may only be described a single ' - f'time. To fix this, remove the macros entry for for {name} in one ' + f'time. To fix this, remove the macros entry for {name} in one ' f'of these files:' f'\n - {patch_1.original_file_path}\n - {patch_2.original_file_path}' ) diff --git a/core/dbt/parser/util.py b/core/dbt/parser/util.py index 3b2a785ca1d..7e31a3e5135 100644 --- a/core/dbt/parser/util.py +++ b/core/dbt/parser/util.py @@ -48,8 +48,8 @@ class ParserUtils: @classmethod def resolve_source( - cls, manifest: Manifest, target_source_name: Optional[str], - target_table_name: Optional[str], current_project: str, + cls, manifest: Manifest, target_source_name: str, + target_table_name: str, current_project: str, node_package: str ) -> Optional[ParsedSourceDefinition]: candidate_targets = [current_project, node_package, None]