tvalentyn commented on code in PR #28500:
URL: https://github.com/apache/beam/pull/28500#discussion_r1329387419


##########
sdks/python/apache_beam/dataframe/frames.py:
##########
@@ -3994,12 +3999,18 @@ def value_counts(self, subset=None, sort=False, 
normalize=False,
       columns = subset or list(self.columns)
 
       if dropna:
-        dropped = self.dropna()
+        # Must include subset here because otherwise we spuriously drop NAs due
+        # to columns outside our subset.
+        dropped = self.dropna(subset=subset)

Review Comment:
   to confirm, this is a bug in existing implementation that got caught in a 
new docstring test?



##########
sdks/python/apache_beam/dataframe/frames.py:
##########
@@ -3994,12 +3999,18 @@ def value_counts(self, subset=None, sort=False, 
normalize=False,
       columns = subset or list(self.columns)
 
       if dropna:
-        dropped = self.dropna()
+        # Must include subset here because otherwise we spuriously drop NAs due
+        # to columns outside our subset.
+        dropped = self.dropna(subset=subset)

Review Comment:
   to confirm, this is a bug in existing implementation that got caught in a 
new docstring test in pandas 2?



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