Skip to content

Commit

Permalink
more conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop committed Dec 5, 2022
1 parent 0d447b3 commit 24b2ff5
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 203 deletions.
4 changes: 2 additions & 2 deletions core/dbt/adapters/base/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Policy,
Path,
)
from dbt.exceptions import InternalException
from dbt.exceptions import InternalException, ApproximateMatch
from dbt.node_types import NodeType
from dbt.utils import filter_null_values, deep_merge, classproperty

Expand Down Expand Up @@ -99,7 +99,7 @@ def matches(

if approximate_match and not exact_match:
target = self.create(database=database, schema=schema, identifier=identifier)
dbt.exceptions.approximate_relation_match(target, self)
raise ApproximateMatch(target, self)

return exact_match

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from dbt.events.functions import warn_or_error
from dbt.events.helpers import env_secrets, scrub_secrets
from dbt.events.types import JinjaLogWarning

from dbt.exceptions import (
RuntimeException,
MissingConfig,
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/context/macro_resolver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Dict, MutableMapping, Optional
from dbt.contracts.graph.parsed import ParsedMacro
from dbt.exceptions import raise_duplicate_macro_name, raise_compiler_error
from dbt.exceptions import DuplicateMacroName, raise_compiler_error
from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME
from dbt.clients.jinja import MacroGenerator

Expand Down Expand Up @@ -86,7 +86,7 @@ def _add_macro_to(
package_namespaces[macro.package_name] = namespace

if macro.name in namespace:
raise_duplicate_macro_name(macro, macro, macro.package_name)
raise DuplicateMacroName(macro, macro, macro.package_name)
package_namespaces[macro.package_name][macro.name] = macro

def add_macro(self, macro: ParsedMacro):
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/context/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dbt.clients.jinja import MacroGenerator, MacroStack
from dbt.contracts.graph.parsed import ParsedMacro
from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME
from dbt.exceptions import raise_duplicate_macro_name, raise_compiler_error
from dbt.exceptions import DuplicateMacroName, raise_compiler_error


FlatNamespace = Dict[str, MacroGenerator]
Expand Down Expand Up @@ -122,7 +122,7 @@ def _add_macro_to(
hierarchy[macro.package_name] = namespace

if macro.name in namespace:
raise_duplicate_macro_name(macro_func.macro, macro, macro.package_name)
raise DuplicateMacroName(macro_func.macro, macro, macro.package_name)
hierarchy[macro.package_name][macro.name] = macro_func

def add_macro(self, macro: ParsedMacro, ctx: Dict[str, Any]):
Expand Down
12 changes: 6 additions & 6 deletions core/dbt/context/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
from dbt.clients import agate_helper
from dbt.clients.jinja import get_rendered, MacroGenerator, MacroStack
from dbt.config import RuntimeConfig, Project
from .base import contextmember, contextproperty, Var
from .configured import FQNLookup
from .context_config import ContextConfig
from dbt.constants import SECRET_ENV_PREFIX, DEFAULT_ENV_PLACEHOLDER
from dbt.context.base import contextmember, contextproperty, Var
from dbt.context.configured import FQNLookup
from dbt.context.context_config import ContextConfig
from dbt.context.exceptions_jinja import wrapped_exports
from dbt.context.macro_resolver import MacroResolver, TestMacroNamespace
from .macros import MacroNamespaceBuilder, MacroNamespace
from .manifest import ManifestContext
from dbt.context.macros import MacroNamespaceBuilder, MacroNamespace
from dbt.context.manifest import ManifestContext
from dbt.contracts.connection import AdapterResponse
from dbt.contracts.graph.manifest import Manifest, Disabled
from dbt.contracts.graph.compiled import (
Expand Down Expand Up @@ -58,7 +59,6 @@
raise_parsing_error,
disallow_secret_env_var,
)
from dbt.jinja_exceptions import wrapped_exports
from dbt.config import IsFQNResource
from dbt.node_types import NodeType, ModelLanguage

Expand Down
Loading

0 comments on commit 24b2ff5

Please sign in to comment.