Merging upstream version 10.6.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
d03a55eda6
commit
ece6881255
48 changed files with 906 additions and 266 deletions
|
@ -114,7 +114,7 @@ def _eliminate_union(scope, existing_ctes, taken):
|
|||
taken[alias] = scope
|
||||
|
||||
# Try to maintain the selections
|
||||
expressions = scope.expression.args.get("expressions")
|
||||
expressions = scope.selects
|
||||
selects = [
|
||||
exp.alias_(exp.column(e.alias_or_name, table=alias), alias=e.alias_or_name)
|
||||
for e in expressions
|
||||
|
|
|
@ -300,7 +300,7 @@ class Scope:
|
|||
list[exp.Expression]: expressions
|
||||
"""
|
||||
if isinstance(self.expression, exp.Union):
|
||||
return []
|
||||
return self.expression.unnest().selects
|
||||
return self.expression.selects
|
||||
|
||||
@property
|
||||
|
|
|
@ -456,8 +456,10 @@ def extract_interval(interval):
|
|||
|
||||
|
||||
def date_literal(date):
|
||||
expr_type = exp.DataType.build("DATETIME" if isinstance(date, datetime.datetime) else "DATE")
|
||||
return exp.Cast(this=exp.Literal.string(date), to=expr_type)
|
||||
return exp.cast(
|
||||
exp.Literal.string(date),
|
||||
"DATETIME" if isinstance(date, datetime.datetime) else "DATE",
|
||||
)
|
||||
|
||||
|
||||
def boolean_literal(condition):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue