Skip to content

Commit

Permalink
add xfail
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-rdurrani committed Apr 27, 2024
1 parent e40a24d commit ce81683
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions tests/integ/modin/groupby/test_groupby_named_agg.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import modin.pandas as pd
import pytest

import snowflake.snowpark.modin.plugin # noqa: F401
from snowflake.snowpark.exceptions import SnowparkSQLException
from tests.integ.modin.sql_counter import sql_count_checker
from tests.integ.modin.utils import eval_snowpark_pandas_result
Expand All @@ -23,12 +22,19 @@ def test_invalid_named_agg_errors(basic_snowpark_pandas_df):


@sql_count_checker(query_count=6)
@pytest.mark.xfail(
reason="SNOW-1336091: Snowpark pandas cannot run in sprocs until modin 0.28.1 is available in conda",
strict=True,
raises=AssertionError,
)
def test_invalid_func_with_named_agg_errors(basic_snowpark_pandas_df):
# Temporary workaround until Anaconda uploads the Modin package
custom_package_usage_config = pd.session.custom_package_usage_config.get(
"enabled", False
)
pd.session.custom_package_usage_config["enabled"] = True
# This test checks that a SnowparkSQLException is raised by this code, since the
# code is invalid. This code relies on falling back to native pandas though,
# so until SNOW-1336091 is fixed, a RuntimeError will instead by raised by the
# Snowpark pandas code. This test then errors out with an AssertionError, since
# the assertion that the raised exception is a SnowparkSQLException is False,
# so we mark it as xfail with raises=AssertionError. When SNOW-1336091 is fixed,
# this test should pass automatically.
eval_snowpark_pandas_result(
basic_snowpark_pandas_df,
basic_snowpark_pandas_df.to_pandas(),
Expand All @@ -37,7 +43,6 @@ def test_invalid_func_with_named_agg_errors(basic_snowpark_pandas_df):
assert_exception_equal=False, # We fallback and then raise the correct error.
expect_exception_type=SnowparkSQLException,
)
pd.session.custom_package_usage_config["enabled"] = custom_package_usage_config


@sql_count_checker(query_count=1)
Expand Down

0 comments on commit ce81683

Please sign in to comment.