TheNeuralBit commented on code in PR #17682:
URL: https://github.com/apache/beam/pull/17682#discussion_r874129298


##########
sdks/python/apache_beam/dataframe/frames_test.py:
##########
@@ -1723,28 +1729,24 @@ def test_groupby_callable(self):
 
   def test_groupby_apply(self):
     df = GROUPBY_DF
-
-    def median_sum_fn(x):
-      return (x.foo + x.bar).median()
-

Review Comment:
   nit: I would actually keep these where they are and just duplicate the 
filterwarnings calls, so that the tests are more self-contained and easy to 
inspect (but I'm also fine with the move if you prefer it that way)



##########
sdks/python/apache_beam/dataframe/frames_test.py:
##########
@@ -1601,6 +1602,11 @@ def test_pivot_no_index_provided_on_multiindex(self):
 
 class GroupByTest(_AbstractFrameTest):
   """Tests for DataFrame/Series GroupBy operations."""
+  @staticmethod
+  def median_sum_fn(x):
+    warnings.filterwarnings("ignore", message="Mean of empty slice")
+    return (x.foo + x.bar).median()

Review Comment:
   Could we use a 
[context](https://docs.python.org/3/library/warnings.html#temporarily-suppressing-warnings)
 here to make sure the filters get reset?



-- 
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]

Reply via email to