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

In dbt run, log relations for the status line instead of explicit node info #2450

Merged
merged 1 commit into from
May 14, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
### Fixes
- When no columns are documented and persist_docs.columns is True, skip creating comments instead of failing with errors ([#2439](https://github.com/fishtown-analytics/dbt/issues/2439), [#2440](https://github.com/fishtown-analytics/dbt/pull/2440))
- Fixed an argument issue with the `create_schema` macro on bigquery ([#2445](https://github.com/fishtown-analytics/dbt/issues/2445), [#2448](https://github.com/fishtown-analytics/dbt/pull/2448))
- dbt now logs using the adapter plugin's ideas about how relations should be displayed ([dbt-spark/#74](https://github.com/fishtown-analytics/dbt-spark/issues/74), [#2450](https://github.com/fishtown-analytics/dbt/pull/2450))


## dbt 0.17.0rc1 (May 12, 2020)
Expand Down
16 changes: 10 additions & 6 deletions core/dbt/node_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,16 @@ def _validate_materialization_relations_dict(

class ModelRunner(CompileRunner):
def get_node_representation(self):
if self.config.credentials.database == self.node.database:
template = "{0.schema}.{0.alias}"
else:
template = "{0.database}.{0.schema}.{0.alias}"

return template.format(self.node)
display_quote_policy = {
'database': False, 'schema': False, 'identifier': False
}
relation = self.adapter.Relation.create_from(
self.config, self.node, quote_policy=display_quote_policy
)
# exclude the database from output if it's the default
if self.node.database == self.config.credentials.database:
relation = relation.include(database=False)
return str(relation)

def describe_node(self):
return "{} model {}".format(self.node.get_materialization(),
Expand Down