grundprinzip commented on code in PR #39254:
URL: https://github.com/apache/spark/pull/39254#discussion_r1058089392
##########
python/pyspark/sql/connect/group.py:
##########
@@ -97,36 +97,46 @@ def agg(self, *exprs: Union[Column, Dict[str, str]]) ->
"DataFrame":
),
session=self._df._session,
)
- return res
agg.__doc__ = PySparkGroupedData.agg.__doc__
- def _map_cols_to_expression(self, fun: str, param: Union[Column, str]) ->
Sequence[Column]:
- return [
- scalar_function(fun, col(param)) if isinstance(param, str) else
param,
- ]
+ def _numeric_agg(self, function: str, cols: Sequence[str]) -> "DataFrame":
+ from pyspark.sql.connect.dataframe import DataFrame
+
+ assert isinstance(function, str) and function in ["min", "max", "avg",
"sum"]
+
+ assert isinstance(cols, list) and all(isinstance(c, str) for c in cols)
+
+ return DataFrame.withPlan(
Review Comment:
Yeah, but why not convert the function to a scalar function like we do for
the above agg method?
--
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]