BryanCutler commented on a change in pull request #27165: [SPARK-28264][PYTHON][SQL] Support type hints in pandas UDF and rename/move inconsistent pandas UDF types URL: https://github.com/apache/spark/pull/27165#discussion_r368764208
########## File path: python/pyspark/sql/tests/test_pandas_cogrouped_map.py ########## @@ -180,59 +176,26 @@ def left_assign_key(key, l, _): assert_frame_equal(expected, result, check_column_type=_check_column_type) def test_wrong_return_type(self): - with QuietTest(self.sc): - with self.assertRaisesRegexp( - NotImplementedError, - 'Invalid returnType.*cogrouped map Pandas UDF.*MapType'): - pandas_udf( - lambda l, r: l, - 'id long, v map<int, int>', - PandasUDFType.COGROUPED_MAP) - - def test_wrong_args(self): # Test that we get a sensible exception invalid values passed to apply left = self.data1 right = self.data2 with QuietTest(self.sc): - # Function rather than a udf - with self.assertRaisesRegexp(ValueError, 'Invalid udf'): - left.groupby('id').cogroup(right.groupby('id')).apply(lambda l, r: l) - - # Udf missing return type - with self.assertRaisesRegexp(ValueError, 'Invalid udf'): - left.groupby('id').cogroup(right.groupby('id'))\ - .apply(udf(lambda l, r: l, DoubleType())) - - # Pass in expression rather than udf - with self.assertRaisesRegexp(ValueError, 'Invalid udf'): - left.groupby('id').cogroup(right.groupby('id')).apply(left.v + 1) - - # Zero arg function Review comment: Isn't this still a valid test? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org