Skip to content

Commit

Permalink
replace float_ in snowpark/mock/pandas_util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-joshi committed Jun 17, 2024
1 parent 8312304 commit 3d942b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/snowflake/snowpark/mock/_pandas_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _extract_schema_and_data_from_pandas_df(
for col_idx in range(data.shape[1]):
if plain_data[row_idx][col_idx] is None:
continue
if isinstance(plain_data[row_idx][col_idx], (float, numpy.float_)):
if isinstance(plain_data[row_idx][col_idx], (float, numpy.float64)):
# in pandas, a float is represented in type numpy.float64
# which can not be inferred by snowpark python, we cast to built-in float type
if math.isnan(plain_data[row_idx][col_idx]):
Expand Down Expand Up @@ -116,7 +116,7 @@ def _extract_schema_and_data_from_pandas_df(
elif isinstance(plain_data[row_idx][col_idx], pd.Interval):

def convert_to_python_obj(obj):
if isinstance(obj, numpy.float_):
if isinstance(obj, numpy.float64):
return float(obj)
elif isinstance(obj, numpy.int64):
# on Windows, numpy.int64 and numpy.int_ are different
Expand Down

0 comments on commit 3d942b7

Please sign in to comment.