Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error message in python 3.8 to_snowpark_pandas daily test #2173

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/integ/test_df_to_snowpark_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# Tests behavior of to_snowpark_pandas() without explicitly initializing Snowpark pandas.

import sys

import pytest

from snowflake.snowpark._internal.utils import TempObjectType
Expand Down Expand Up @@ -47,9 +49,14 @@ def test_to_snowpark_pandas_no_modin(session, tmp_table_basic):
# TODO: SNOW-1552497: after upgrading to modin 0.30.1, Snowpark pandas will support
# all pandas 2.2.x, and this function call will raise a ModuleNotFoundError since
# modin is not installed.
match = (
"Snowpark pandas does not support Python 3.8. Please update to Python 3.9 or later"
if sys.version_info.major == 3 and sys.version_info.minor == 8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we care about message for earlier versions of python, ie. < 3.8 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Within Snowpark pandas, we currently check if the version ==3.8. Older Python versions have been EOL'd anyway, and even if a user somehow manages to set up a Snowpark (pandas or non-pandas) environment, they would encounter an error when trying to import pandas anyway since pandas 2.1+ only works with Python 3.9 and later.

else "does not match the supported pandas version in Snowpark pandas"
)
with pytest.raises(
RuntimeError,
match="does not match the supported pandas version in Snowpark pandas",
match=match,
):
snowpark_df.to_snowpark_pandas()
else:
Expand Down
Loading