From ccb02afc396a4a9be6e57e6fd913417f3a781cea Mon Sep 17 00:00:00 2001 From: Adam Ling Date: Fri, 23 Aug 2024 13:56:33 -0700 Subject: [PATCH] update --- .../snowpark/_internal/analyzer/analyzer.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/snowflake/snowpark/_internal/analyzer/analyzer.py b/src/snowflake/snowpark/_internal/analyzer/analyzer.py index 85d6d58088f..6567754d229 100644 --- a/src/snowflake/snowpark/_internal/analyzer/analyzer.py +++ b/src/snowflake/snowpark/_internal/analyzer/analyzer.py @@ -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() }, ) @@ -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