amaliujia commented on code in PR #38768:
URL: https://github.com/apache/spark/pull/38768#discussion_r1031750623
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -51,24 +52,11 @@
class GroupingFrame(object):
Review Comment:
Renamed
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -51,24 +52,11 @@
class GroupingFrame(object):
-
- MeasuresType = Union[Sequence[Tuple["ExpressionOrString", str]], Dict[str,
str]]
- OptMeasuresType = Optional[MeasuresType]
-
def __init__(self, df: "DataFrame", *grouping_cols: Union[Column, str]) ->
None:
self._df = df
self._grouping_cols = [x if isinstance(x, Column) else df[x] for x in
grouping_cols]
- def agg(self, exprs: Optional[MeasuresType] = None) -> "DataFrame":
-
- # Normalize the dictionary into a list of tuples.
- if isinstance(exprs, Dict):
- measures = list(exprs.items())
- elif isinstance(exprs, List):
- measures = exprs
- else:
- measures = []
-
+ def agg(self, measures: Sequence[Expression]) -> "DataFrame":
res = DataFrame.withPlan(
Review Comment:
added.
--
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]