Skip to content

Commit

Permalink
use try/except/else
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-joshi committed Aug 20, 2024
1 parent 33b5bcb commit 4457539
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/integ/test_df_to_snowpark_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ def test_to_snowpark_pandas_no_modin(session, tmp_table_basic):
# Check if modin is installed (if so, we're running in Snowpark pandas; if not, we're just in Snowpark Python)
try:
import modin # noqa: F401

modin_installed = True
except ModuleNotFoundError:
modin_installed = False
if modin_installed:
snowpark_df.to_snowpark_pandas() # should have no errors
else:
# Current Snowpark Python installs pandas==2.2.2, but Snowpark pandas depends on modin
# 0.28.1, which needs pandas==2.2.1. The pandas version check is currently performed
# before Snowpark pandas checks whether modin is installed.
Expand All @@ -58,3 +52,5 @@ def test_to_snowpark_pandas_no_modin(session, tmp_table_basic):
match="does not match the supported pandas version in Snowpark pandas",
):
snowpark_df.to_snowpark_pandas()
else:
snowpark_df.to_snowpark_pandas() # should have no errors

0 comments on commit 4457539

Please sign in to comment.