Skip to content

Commit

Permalink
(#1768) standardize snapshot cli output
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin committed Sep 18, 2019
1 parent 0fa4523 commit e2e509b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 6 additions & 3 deletions core/dbt/node_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,14 @@ def after_execute(self, result):

class SnapshotRunner(ModelRunner):
def describe_node(self):
return "snapshot {}".format(self.node.name)
return "snapshot {}".format(self.get_node_representation())

def print_result_line(self, result):
dbt.ui.printer.print_snapshot_result_line(result, self.node_index,
self.num_nodes)
dbt.ui.printer.print_snapshot_result_line(
result,
self.get_node_representation(),
self.node_index,
self.num_nodes)


class SeedRunner(ModelRunner):
Expand Down
8 changes: 5 additions & 3 deletions core/dbt/ui/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,16 @@ def print_model_result_line(
result.execution_time)


def print_snapshot_result_line(result, index: int, total: int):
def print_snapshot_result_line(
result, description: str, index: int, total: int
) -> None:
model = result.node

info, status = get_printable_result(result, 'snapshotted', 'snapshotting')
cfg = model.config.to_dict()

msg = "{info} {name}".format(
info=info, name=model.name, **cfg)
msg = "{info} {description}".format(
info=info, description=description, **cfg)
print_fancy_output_line(
msg,
status,
Expand Down

0 comments on commit e2e509b

Please sign in to comment.