Skip to content

Commit

Permalink
reformat relation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-rogers-dbt committed Apr 22, 2024
1 parent ec1f8a2 commit 80b9309
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dbt/adapters/base/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class BaseRelation(FakeAPIObject, Hashable):
quote_policy: Policy = field(default_factory=lambda: Policy())
dbt_created: bool = False
limit: Optional[int] = None
require_alias: bool = True # used to govern whether to add an alias when render_limited is called
require_alias: bool = (
True # used to govern whether to add an alias when render_limited is called
)

# register relation types that can be renamed for the purpose of replacing relations using stages and backups
# adding a relation type here also requires defining the associated rename macro
Expand Down Expand Up @@ -207,7 +209,7 @@ def render(self) -> str:
return ".".join(part for _, part in self._render_iterator() if part is not None)

def _render_limited_alias(self) -> str:
""" Some databases require an alias for subqueries (postgres, mysql) for all others we want to avoid adding
"""Some databases require an alias for subqueries (postgres, mysql) for all others we want to avoid adding
an alias as it has the potential to introduce issues with the query if the user also defines an alias.
"""
if self.require_alias:
Expand Down

0 comments on commit 80b9309

Please sign in to comment.