Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize snapshot CLI output #1769

Merged
merged 1 commit into from
Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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