Skip to content

Commit edc7838

Browse files
committed
Apply suggestions from code review
1 parent 13973de commit edc7838

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

ibis/backends/pyspark/tests/test_udf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ def test_python_udf(t, df):
4545
tm.assert_frame_equal(result, expected)
4646

4747

48-
@pytest.mark.skipif(PYSPARK_LT_35, reason="pyarrow UDFs require PySpark 3.5+")
48+
@pytest.mark.xfail(PYSPARK_LT_35, reason="pyarrow UDFs require PySpark 3.5+")
4949
def test_pyarrow_udf(t, df):
5050
result = t.mutate(repeated=pyarrow_repeat(t.str_col, 2)).execute()
5151
expected = df.assign(repeated=df.str_col * 2)
5252
tm.assert_frame_equal(result, expected)
5353

5454

55-
@pytest.mark.skipif(not PYSPARK_LT_35, reason="pyarrow UDFs require PySpark 3.5+")
55+
@pytest.mark.xfail(not PYSPARK_LT_35, reason="pyarrow UDFs require PySpark 3.5+")
5656
def test_illegal_udf_type(t):
5757
@ibis.udf.scalar.pyarrow
5858
def my_add_one(x) -> str:

ibis/backends/tests/test_udf.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66

77
import ibis.common.exceptions as com
88
from ibis import _, udf
9-
10-
try:
11-
from ibis.backends.pyspark import PYSPARK_LT_35
12-
except ImportError:
13-
# Workaround when pyspark is not installed
14-
PYSPARK_LT_35 = True
159
from ibis.backends.tests.errors import Py4JJavaError
1610

1711
no_python_udfs = mark.notimpl(
@@ -37,13 +31,6 @@
3731
reason="Docker image has Python 3.10, results in `cloudpickle` version mismatch",
3832
)
3933

40-
pyspark_version_mismatch = mark.notimpl(
41-
["pyspark"],
42-
condition=PYSPARK_LT_35,
43-
raises=NotImplementedError,
44-
reason="pyarrow UDFs require PySpark 3.5+",
45-
)
46-
4734

4835
@no_python_udfs
4936
@cloudpickle_version_mismatch
@@ -188,7 +175,7 @@ def add_one_pyarrow(s: int) -> int: # s is series, int is the element type
188175
raises=NotImplementedError,
189176
reason="backend doesn't support pyarrow UDFs",
190177
),
191-
pyspark_version_mismatch,
178+
mark.xfail_version(pyspark=["pyspark<3.5"]),
192179
],
193180
),
194181
],

0 commit comments

Comments
 (0)