1
0
Fork 0

Merging upstream version 26.15.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-04-21 09:50:04 +02:00
parent 2a79d9df75
commit de6539b796
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
58 changed files with 4878 additions and 4677 deletions

View file

@ -93,15 +93,18 @@ def remove_redundant_casts(expression: exp.Expression) -> exp.Expression:
if (
isinstance(expression, exp.Cast)
and expression.this.type
and expression.to.this == expression.this.type.this
and expression.to == expression.this.type
):
return expression.this
if (
isinstance(expression, (exp.Date, exp.TsOrDsToDate))
and expression.this.type
and expression.this.type.this == exp.DataType.Type.DATE
and not expression.this.type.expressions
):
return expression.this
return expression

View file

@ -105,7 +105,7 @@ def unnest(select, parent_select, next_alias_name):
.from_(select.subquery("_q", copy=False), copy=False)
.group_by(exp.column(value.alias, "_q"), copy=False)
)
else:
elif not find_in_scope(value.this, exp.AggFunc):
select = select.group_by(value.this, copy=False)
parent_select.join(