Skip to content

Commit

Permalink
More logging touchups
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 committed Feb 21, 2024
1 parent 971584a commit 4aa8b57
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion core/dbt/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def print_compile_stats(stats: Dict[NodeType, int]):
dbt.tracking.track_resource_counts(resource_counts)

# do not include resource types that are not actually defined in the project
stat_line = ", ".join([pluralize(ct, t) for t, ct in stats.items() if ct != 0])
stat_line = ", ".join(
[pluralize(ct, t).replace("_", " ") for t, ct in stats.items() if ct != 0]
)
fire_event(FoundStats(stat_line=stat_line))


Expand All @@ -77,6 +79,7 @@ def _generate_stats(manifest: Manifest) -> Dict[NodeType, int]:
stats[NodeType.Macro] += len(manifest.macros)
stats[NodeType.Group] += len(manifest.groups)
stats[NodeType.SemanticModel] += len(manifest.semantic_models)
stats[NodeType.SavedQuery] += len(manifest.saved_queries)
stats[NodeType.Unit] += len(manifest.unit_tests)

# TODO: should we be counting dimensions + entities?
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/task/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SavedQueryRunner(BaseRunner):
# Stub. No-op Runner for Saved Queries, which require MetricFlow for execution.
@property
def description(self):
return self.node.unique_id
return f"saved query {self.node.name}"

Check warning on line 24 in core/dbt/task/build.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/task/build.py#L24

Added line #L24 was not covered by tests

def before_execute(self):
pass

Check warning on line 27 in core/dbt/task/build.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/task/build.py#L27

Added line #L27 was not covered by tests
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/task/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ def get_counts(flat_nodes) -> str:
if node.resource_type == NodeType.Model:
t = "{} {}".format(node.get_materialization(), t)
elif node.resource_type == NodeType.Operation:
t = "hook"
t = "project hook"

counts[t] = counts.get(t, 0) + 1

stat_line = ", ".join([pluralize(v, k) for k, v in counts.items()])
stat_line = ", ".join([pluralize(v, k).replace("_", " ") for k, v in counts.items()])

return stat_line

Expand Down

0 comments on commit 4aa8b57

Please sign in to comment.