tvalentyn commented on code in PR #26406:
URL: https://github.com/apache/beam/pull/26406#discussion_r1177941132
##########
sdks/python/apache_beam/transforms/combiners.py:
##########
@@ -195,11 +195,12 @@ class Top(object):
@with_input_types(T)
@with_output_types(List[T])
class Of(CombinerWithoutDefaults):
- """Obtain a list of the compare-most N elements in a PCollection.
+ """Obtain a list of the n greatest elements in a PCollection.
Review Comment:
```suggestion
"""Obtain a list of the N greatest elements in a PCollection.
```
##########
sdks/python/apache_beam/transforms/combiners.py:
##########
@@ -195,11 +195,12 @@ class Top(object):
@with_input_types(T)
@with_output_types(List[T])
class Of(CombinerWithoutDefaults):
- """Obtain a list of the compare-most N elements in a PCollection.
+ """Obtain a list of the n greatest elements in a PCollection.
This transform will retrieve the n greatest elements in the PCollection
- to which it is applied, where "greatest" is determined by the comparator
- function supplied as the compare argument.
+ to which it is applied, where "greatest" is determined by a
+ function supplied as the key or reverse arguments.
+
Review Comment:
nit: extra newline
##########
sdks/python/apache_beam/transforms/combiners.py:
##########
@@ -249,12 +250,13 @@ def expand(self, pcoll):
@with_input_types(Tuple[K, V])
@with_output_types(Tuple[K, List[V]])
class PerKey(ptransform.PTransform):
- """Identifies the compare-most N elements associated with each key.
+ """Identifies the N greatest elements associated with each key.
This transform will produce a PCollection mapping unique keys in the input
PCollection to the n greatest elements with which they are associated,
where
- "greatest" is determined by the comparator function supplied as the compare
- argument in the initializer.
+ "greatest" is determined by a function supplied as the key or
Review Comment:
let's back-tick param names. eg. \`key\`
##########
sdks/python/apache_beam/transforms/combiners.py:
##########
@@ -249,12 +250,13 @@ def expand(self, pcoll):
@with_input_types(Tuple[K, V])
@with_output_types(Tuple[K, List[V]])
class PerKey(ptransform.PTransform):
- """Identifies the compare-most N elements associated with each key.
+ """Identifies the N greatest elements associated with each key.
This transform will produce a PCollection mapping unique keys in the input
PCollection to the n greatest elements with which they are associated,
where
- "greatest" is determined by the comparator function supplied as the compare
- argument in the initializer.
+ "greatest" is determined by a function supplied as the key or
+ reverse arguments.
+
Review Comment:
nit: extra newline
--
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]