ueshin commented on a change in pull request #32886:
URL: https://github.com/apache/spark/pull/32886#discussion_r653790570



##########
File path: python/pyspark/pandas/base.py
##########
@@ -768,7 +768,7 @@ def ndim(self) -> int:
         """
         return 1
 
-    def astype(self, dtype: Union[str, type, Dtype]) -> Union["Index", 
"Series"]:
+    def astype(self, dtype: Union[str, type, Dtype]) -> Union["Index", 
"Series", "DataFrame"]:

Review comment:
       I think this is not a good idea because this never returns `DataFrame`.
   @pingsutw Could you revert this change?

##########
File path: python/pyspark/pandas/window.py
##########
@@ -120,7 +130,12 @@ def var(scol):
 
 
 class Rolling(RollingAndExpanding):
-    def __init__(self, psdf_or_psser, window, min_periods=None):
+    def __init__(
+        self,
+        psdf_or_psser: Union["Series", "DataFrame"],
+        window: int,
+        min_periods: int = None,

Review comment:
       `Optional[int]`?

##########
File path: python/pyspark/pandas/window.py
##########
@@ -621,12 +638,17 @@ def var(self) -> Union["Series", "DataFrame"]:
 
 
 class RollingGroupby(Rolling):
-    def __init__(self, groupby, window, min_periods=None):
+    def __init__(
+        self,
+        groupby: Union["SeriesGroupBy", "DataFrameGroupBy"],
+        window: int,
+        min_periods: int = None,

Review comment:
       ditto.




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to