Skip to content

Commit

Permalink
Refactor: override Bracket.output_name only when there's one bracket …
Browse files Browse the repository at this point in the history
…expression
  • Loading branch information
georgesittas committed Sep 11, 2023
1 parent f3ad3aa commit a81dd14
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sqlglot/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3962,8 +3962,11 @@ class Bracket(Condition):
arg_types = {"this": True, "expressions": True}

@property
def output_name(self):
return self.expressions[0].this
def output_name(self) -> str:
if len(self.expressions) == 1:
return self.expressions[0].output_name

return super().output_name


class SafeBracket(Bracket):
Expand Down

0 comments on commit a81dd14

Please sign in to comment.