Skip to content

Commit

Permalink
Reference model.identifier and model.name where appropriate to resolv…
Browse files Browse the repository at this point in the history
…e typing errors
  • Loading branch information
jeancochrane committed Jul 16, 2024
1 parent ddaeffc commit 582f972
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/dbt/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ def _create_node_context(

return context

def add_ephemeral_prefix(self, alias: str):
def add_ephemeral_prefix(self, name: str):
adapter = get_adapter(self.config)
relation_cls = adapter.Relation
return relation_cls.add_ephemeral_prefix(alias)
return relation_cls.add_ephemeral_prefix(name)

def _recursively_prepend_ctes(
self,
Expand Down Expand Up @@ -371,7 +371,7 @@ def _recursively_prepend_ctes(

_extend_prepended_ctes(prepended_ctes, new_prepended_ctes)

new_cte_name = self.add_ephemeral_prefix(cte_model.alias)
new_cte_name = self.add_ephemeral_prefix(cte_model.identifier)
rendered_sql = cte_model._pre_injected_sql or cte_model.compiled_code
sql = f" {new_cte_name} as (\n{rendered_sql}\n)"

Expand Down
2 changes: 1 addition & 1 deletion core/dbt/context/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,7 @@ def this(self) -> Optional[str]:
if self.model.this_input_node_unique_id:
this_node = self.manifest.expect(self.model.this_input_node_unique_id)
self.model.set_cte(this_node.unique_id, None) # type: ignore
return self.adapter.Relation.add_ephemeral_prefix(this_node.alias)
return self.adapter.Relation.add_ephemeral_prefix(this_node.name)
return None


Expand Down

0 comments on commit 582f972

Please sign in to comment.