ueshin commented on code in PR #54162:
URL: https://github.com/apache/spark/pull/54162#discussion_r2771981731
##########
python/pyspark/pandas/tests/groupby/test_stat.py:
##########
@@ -35,11 +39,23 @@ def _test_stat_func(self, func, check_exact=True):
# Against SeriesGroupBy
(pdf.groupby("A")["B"], psdf.groupby("A")["B"]),
]:
- self.assert_eq(
- func(p_groupby_obj).sort_index(),
- func(ps_groupby_obj).sort_index(),
- check_exact=check_exact,
- )
+ if expected_error is None:
+ self.assert_eq(
+ func(p_groupby_obj).sort_index(),
+ func(ps_groupby_obj).sort_index(),
+ check_exact=check_exact,
+ )
+ else:
+ error_type, error_message = expected_error
+ self.assertRaisesRegex(error_type, error_message, lambda:
func(p_groupby_obj))
+ self.assertRaisesRegex(error_type, error_message, lambda:
func(ps_groupby_obj))
+
+ @property
+ def expected_error_numeric_only(self) -> Optional[Tuple[Type[Exception],
str]]:
Review Comment:
So you want a global variable `using_pandas3` over the utility function?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]