Skip to content

Commit 7201f80

Browse files
committed
fix removed alias
1 parent 3b25773 commit 7201f80

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/snowflake/snowpark/dataframe.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,8 @@ def _alias_if_needed(
293293
)
294294
return col.alias(f'"{prefix}{unquoted_col_name}"')
295295
else:
296-
# No alias needed when source name equals destination name.
297-
# Populate expr_to_alias directly instead of creating redundant Alias expression.
298-
# This avoids generating "A" AS "A" in SQL while still maintaining column tracking.
299-
quoted_name = quote_name(unquoted_col_name)
300-
df._plan.expr_to_alias[col._expression.expr_id] = quoted_name
301-
return col
296+
# Removal of redundant aliases (like `"A" AS "A"`) is handled at the analyzer level.
297+
return col.alias(f'"{unquoted_col_name}"')
302298

303299

304300
def _populate_expr_to_alias(df: "DataFrame") -> None:

0 commit comments

Comments
 (0)