You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2024/04/09 01:51:15 UTC
(spark) branch master updated: [MINOR][TESTS] Make `check_invalid_args` reusable in parity test
This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new fea1994fe756 [MINOR][TESTS] Make `check_invalid_args` reusable in parity test
fea1994fe756 is described below
commit fea1994fe756c6bc385c2f9769acc6c82f3a2a68
Author: Ruifeng Zheng <ru...@apache.org>
AuthorDate: Tue Apr 9 10:51:04 2024 +0900
[MINOR][TESTS] Make `check_invalid_args` reusable in parity test
### What changes were proposed in this pull request?
Make `check_invalid_args` reusable in parity test
### Why are the changes needed?
test coverage
### Does this PR introduce _any_ user-facing change?
no, test only
### How was this patch tested?
ci
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #45928 from zhengruifeng/enable_test_invalid_args.
Authored-by: Ruifeng Zheng <ru...@apache.org>
Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
.../sql/tests/connect/test_parity_pandas_udf_window.py | 11 +++++------
python/pyspark/sql/tests/pandas/test_pandas_udf_window.py | 2 +-
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/python/pyspark/sql/tests/connect/test_parity_pandas_udf_window.py b/python/pyspark/sql/tests/connect/test_parity_pandas_udf_window.py
index 98ed2a23df30..b2288c9d949e 100644
--- a/python/pyspark/sql/tests/connect/test_parity_pandas_udf_window.py
+++ b/python/pyspark/sql/tests/connect/test_parity_pandas_udf_window.py
@@ -20,12 +20,11 @@ from pyspark.sql.tests.pandas.test_pandas_udf_window import WindowPandasUDFTests
from pyspark.testing.connectutils import ReusedConnectTestCase
-class PandasUDFWindowParityTests(WindowPandasUDFTestsMixin, ReusedConnectTestCase):
- # TODO(SPARK-43734): Expression "<lambda>(v)" within a window function doesn't raise a
- # AnalysisException
- @unittest.skip("Fails in Spark Connect, should enable.")
- def test_invalid_args(self):
- super().test_invalid_args()
+class PandasUDFWindowParityTests(
+ WindowPandasUDFTestsMixin,
+ ReusedConnectTestCase,
+):
+ pass
if __name__ == "__main__":
diff --git a/python/pyspark/sql/tests/pandas/test_pandas_udf_window.py b/python/pyspark/sql/tests/pandas/test_pandas_udf_window.py
index 5ad136da726d..9b3673d80d22 100644
--- a/python/pyspark/sql/tests/pandas/test_pandas_udf_window.py
+++ b/python/pyspark/sql/tests/pandas/test_pandas_udf_window.py
@@ -292,7 +292,7 @@ class WindowPandasUDFTestsMixin:
with self.assertRaisesRegex(AnalysisException, ".*not supported within a window function"):
foo_udf = pandas_udf(lambda x: x, "v double", PandasUDFType.GROUPED_MAP)
- df.withColumn("v2", foo_udf(df["v"]).over(w))
+ df.withColumn("v2", foo_udf(df["v"]).over(w)).schema
def test_bounded_simple(self):
from pyspark.sql.functions import mean, max, min, count
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org