Skip to content

Commit

Permalink
fix: order of the combine list
Browse files Browse the repository at this point in the history
Make nicer the logs
  • Loading branch information
Virginia Lopez-Gil committed May 2, 2021
1 parent 4dc027d commit 356dc06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dbt_sugar/core/task/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def update_model_description_test_tags(
tests = dict_column_description_to_update[column_name].get("tests")
if tests:
column["tests"] = self.combine_two_list_without_duplicates(
column.get("tests", []), tests
tests, column.get("tests", [])
)

# Update the tags without duplicating them.
Expand Down
9 changes: 5 additions & 4 deletions dbt_sugar/core/task/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def move_name_and_description_to_first_position(self, model: Dict[str, Any]):
"""
# DEPRECATION: Drop ordered dict when dropping python 3.6 support
ordered_dict = OrderedDict(model)
ordered_dict.move_to_end("description", last=False)
if ordered_dict.get("description"):
ordered_dict.move_to_end("description", last=False)
ordered_dict.move_to_end("name", last=False)
return ordered_dict

Expand Down Expand Up @@ -311,9 +312,9 @@ def check_tests(self, path_file: Path, model_name: str) -> None:

if "Compilation Error" in dbt_result_command:
logger.info(
"There's have been a compilation error in one or more custom tests that you have added.\n"
"Not able to check if the tests that you have added has PASS.\n"
f"The dbt original logs: {dbt_result_command}"
"dbt encountered a compilation error in one or more of your custom tests.\n"
"Not able to check if the tests that you have added have PASSED.\n"
f"This is what dbt's compilation error says:\n{dbt_result_command}"
)

for column in self.column_update_payload.keys():
Expand Down

0 comments on commit 356dc06

Please sign in to comment.