Skip to content

Commit

Permalink
Add language on error nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Oct 5, 2022
1 parent 86eb68f commit bc8b650
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/dbt/parser/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _mangle_hooks(self, config):
config[key] = [hooks.get_hook_dict(h) for h in config[key]]

def _create_error_node(
self, name: str, path: str, original_file_path: str, raw_code: str, language: str = "sql"
self, name: str, path: str, original_file_path: str, raw_code: str, language: str
) -> UnparsedNode:
"""If we hit an error before we've actually parsed a node, provide some
level of useful information by attaching this to the exception.
Expand Down Expand Up @@ -227,7 +227,7 @@ def _create_parsetime_node(
path=path,
original_file_path=block.path.original_file_path,
raw_code=block.contents,
# language=language,
language=language,
)
raise ParsingException(msg, node=node)

Expand Down
2 changes: 1 addition & 1 deletion core/dbt/parser/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def get_hashable_md(data: Union[str, int, float, List, Dict]) -> Union[str, List
path=path,
original_file_path=target.original_file_path,
raw_code=raw_code,
# language="sql",
language="sql",
)
raise ParsingException(msg, node=node) from exc

Expand Down

0 comments on commit bc8b650

Please sign in to comment.