You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/09/16 00:37:38 UTC

[GitHub] [spark] itholic commented on a diff in pull request #37897: [SPARK-40445][PS] Refactor `Resampler` for consistency and simplicity

itholic commented on code in PR #37897:
URL: https://github.com/apache/spark/pull/37897#discussion_r972518208


##########
python/pyspark/pandas/resample.py:
##########
@@ -481,20 +489,5 @@ def __getattr__(self, item: str) -> Any:
             else:
                 return partial(property_or_func, self)
 
-    def min(self) -> Series:
-        return first_series(self._downsample("min"))
-
-    def max(self) -> Series:
-        return first_series(self._downsample("max"))
-
-    def sum(self) -> Series:
-        return first_series(self._downsample("sum").fillna(0.0))
-
-    def mean(self) -> Series:
-        return first_series(self._downsample("mean"))
-
-    def std(self) -> Series:
-        return first_series(self._downsample("std"))
-
-    def var(self) -> Series:
-        return first_series(self._downsample("var"))
+    def _cleanup_and_return(self, psdf: DataFrame) -> Series:
+        return first_series(psdf).rename().rename(self._psser.name)

Review Comment:
   qq: Why we do rename twice here?



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org