Merging upstream version 17.11.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
2bd548fc43
commit
14ca349bca
69 changed files with 30974 additions and 30030 deletions
|
@ -191,6 +191,13 @@ class Expression(metaclass=_Expression):
|
|||
return self.args["alias"].name
|
||||
return self.text("alias")
|
||||
|
||||
@property
|
||||
def alias_column_names(self) -> t.List[str]:
|
||||
table_alias = self.args.get("alias")
|
||||
if not table_alias:
|
||||
return []
|
||||
return [c.name for c in table_alias.args.get("columns") or []]
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return self.text("this")
|
||||
|
@ -883,13 +890,6 @@ class Predicate(Condition):
|
|||
|
||||
|
||||
class DerivedTable(Expression):
|
||||
@property
|
||||
def alias_column_names(self) -> t.List[str]:
|
||||
table_alias = self.args.get("alias")
|
||||
if not table_alias:
|
||||
return []
|
||||
return [c.name for c in table_alias.args.get("columns") or []]
|
||||
|
||||
@property
|
||||
def selects(self) -> t.List[Expression]:
|
||||
return self.this.selects if isinstance(self.this, Subqueryable) else []
|
||||
|
@ -4860,8 +4860,18 @@ def maybe_parse(
|
|||
return sqlglot.parse_one(sql, read=dialect, into=into, **opts)
|
||||
|
||||
|
||||
@t.overload
|
||||
def maybe_copy(instance: None, copy: bool = True) -> None:
|
||||
...
|
||||
|
||||
|
||||
@t.overload
|
||||
def maybe_copy(instance: E, copy: bool = True) -> E:
|
||||
return instance.copy() if copy else instance
|
||||
...
|
||||
|
||||
|
||||
def maybe_copy(instance, copy=True):
|
||||
return instance.copy() if copy and instance else instance
|
||||
|
||||
|
||||
def _is_wrong_expression(expression, into):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue