Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke committed Sep 27, 2024
1 parent 5d1b980 commit 7fb3ccf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/dbt/parser/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def parse_file(self, block: FileBlock, dct: Optional[Dict] = None) -> None:
except ParsingError as e:
fire_event(

Check warning on line 219 in core/dbt/parser/schemas.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/parser/schemas.py#L215-L219

Added lines #L215 - L219 were not covered by tests
Note(
msg=f"Unable to parse 'data_tests' in {block.path.original_file_path}\n{e}",
msg=f"Unable to parse 'data_tests' section of file '{block.path.original_file_path}'\n{e}",
),
EventLevel.WARN,
)
Expand Down
6 changes: 4 additions & 2 deletions tests/functional/data_test_patch/test_singular_test_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_compile(self, project):
_, log_output = run_dbt_and_capture(["compile"])

file_path = (
"tests\\schem a_with_invalid_name.yml"
"tests\\schema_with_invalid_name.yml"
if os.name == "nt"
else "tests/schema_with_invalid_name.yml"
)
Expand All @@ -64,4 +64,6 @@ def tests(self):

def test_compile(self, project):
_, log_output = run_dbt_and_capture(["compile"])
assert "Unable to parse 'data_tests' in tests/schema.yml" in log_output
file_path = "tests\\schema.yml" if os.name == "nt" else "tests/schema.yml"
assert f"Unable to parse 'data_tests' section of file '{file_path}'" in log_output
assert "Entry did not contain a name" in log_output

0 comments on commit 7fb3ccf

Please sign in to comment.