Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-aling committed Aug 23, 2024
1 parent 52c381a commit ccb02af
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/snowflake/snowpark/_internal/analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,16 +605,9 @@ def table_function_expression_extractor(
sql = named_arguments_function(
expr.func_name,
{
key: self.analyze(
key: self.to_sql_try_avoid_cast(
value, df_aliased_col_name_to_real_col_name, parse_local_name
)
if not (
expr.func_name.lower() == "flatten"
and key.lower() == "outer"
and isinstance(value, Literal)
and isinstance(value.datatype, BooleanType)
)
else str(value.value).upper()
for key, value in expr.args.items()
},
)
Expand Down Expand Up @@ -752,6 +745,12 @@ def to_sql_try_avoid_cast(
# otherwise process as normal
if isinstance(expr, Literal) and isinstance(expr.datatype, _NumericType):
return numeric_to_sql_without_cast(expr.value, expr.datatype)
elif (
isinstance(expr, Literal)
and isinstance(expr.datatype, BooleanType)
and isinstance(expr.value, bool)
):
return str(expr.value).upper()
else:
return self.analyze(
expr, df_aliased_col_name_to_real_col_name, parse_local_name
Expand Down

0 comments on commit ccb02af

Please sign in to comment.