robertwb commented on a change in pull request #12812:
URL: https://github.com/apache/beam/pull/12812#discussion_r488315040



##########
File path: sdks/python/apache_beam/dataframe/frames.py
##########
@@ -551,9 +559,13 @@ def merge(
       return merged.reset_index(drop=True)
 
   @frame_base.args_to_kwargs(pd.DataFrame)
-  def nlargest(self, **kwargs):
-    if 'keep' in kwargs and kwargs['keep'] != 'all':
+  @frame_base.populate_defaults(pd.DataFrame)
+  def nlargest(self, keep, **kwargs):
+    if keep == 'any':
+      keep = 'first'

Review comment:
       Yep, exactly. Dropped a TODO. I'm thinking we may want a context (like 
we have for non-parallel operations) for operations like this to explicitly say 
that one doesn't care about ordering (e.g. `nlargest` would default to `any` so 
`df.nlargest(10)` would just work as-is. 
   
   
   PartitioningSession caused the rows to get perumuted. 




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


Reply via email to