Skip to content

Commit dac9267

Browse files
committed
revert copy
1 parent e7fc838 commit dac9267

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

sqlglot/optimizer/annotate_types.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,8 @@ def _get_scope_selects(self, scope: Scope) -> dict[str, dict[str, t.Any]]:
330330
pivot_source.name if isinstance(pivot_source, exp.Table) else pivot.alias
331331
)
332332

333-
source_types = selects.get(inner_name, {})
333+
col_types = selects.get(inner_name, {}).copy()
334334

335-
col_types = {}
336335
if pivot.unpivot:
337336
for field in pivot.fields:
338337
field_col = field.this
@@ -360,7 +359,7 @@ def _get_scope_selects(self, scope: Scope) -> dict[str, dict[str, t.Any]]:
360359
else [val_expr]
361360
)
362361
for val_col, src_col in zip(val_cols, src_cols):
363-
src_type = source_types.get(src_col.output_name) or src_col.type
362+
src_type = col_types.get(src_col.output_name) or src_col.type
364363
if isinstance(src_type, exp.DataType) and not src_type.is_type(
365364
exp.DType.UNKNOWN
366365
):

0 commit comments

Comments
 (0)