Skip to content

Commit

Permalink
flip around generate_alias_name args
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin committed May 28, 2019
1 parent 73607b8 commit 192e146
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
{#
Renders a alias name given a custom alias name. If the custom
alias name is none, then the resulting alias is just the filename of the
model. If a alias override is specified, then that is used.
model. If an alias override is specified, then that is used.

This macro can be overriden in projects to define different semantics
for rendering a alias name.

Arguments:
custom_alias_name: The custom alias name specified for a model, or none
node: The available node that an alias is being generated for, or none

#}
{% macro generate_alias_name(node, custom_alias_name=none) -%}
{% macro generate_alias_name(custom_alias_name=none, node=none) -%}

{%- if custom_alias_name is none -%}

Expand Down
2 changes: 1 addition & 1 deletion core/dbt/parser/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _update_parsed_node_info(self, parsed_node, config):

alias_override = config.config.get('alias')
get_alias = self.get_alias_func()
parsed_node.alias = get_alias(parsed_node, alias_override).strip()
parsed_node.alias = get_alias(alias_override, parsed_node).strip()

parsed_node.database = config.config.get(
'database', self.default_database
Expand Down

0 comments on commit 192e146

Please sign in to comment.