From 714e767b185db154ea5aeae5a982871d2221a880 Mon Sep 17 00:00:00 2001 From: Afroz Alam Date: Wed, 30 Oct 2024 12:55:10 -0700 Subject: [PATCH] fix pandas dependency issue (#2537) --- src/snowflake/snowpark/dataframe.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/snowflake/snowpark/dataframe.py b/src/snowflake/snowpark/dataframe.py index a77899dd83c..a0a3a430d7c 100644 --- a/src/snowflake/snowpark/dataframe.py +++ b/src/snowflake/snowpark/dataframe.py @@ -4522,27 +4522,27 @@ def map( for i, col_name in enumerate(output_column_names) ] - def wrap_result(result): - if vectorized: + if vectorized: + + def wrap_result(result): if isinstance(result, pandas.DataFrame) or isinstance(result, tuple): return result return (result,) - if isinstance(result, Row): - return tuple(result) - elif isinstance(result, tuple): - return result - else: - return (result,) - - if vectorized: - class _MapFunc: def process(self, pdf): return wrap_result(func(pdf)) else: + def wrap_result(result): + if isinstance(result, Row): + return tuple(result) + elif isinstance(result, tuple): + return result + else: + return (result,) + class _MapFunc: def process(self, *argv): input_args_to_row = Row(*df_columns)