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


##########
python/pyspark/pandas/window.py:
##########
@@ -144,10 +144,15 @@ def __init__(
         window: int,
         min_periods: Optional[int] = None,
     ):
+        if type(window) is not int:

Review Comment:
   Can we use `isinstance` instead ?
   
   ```python
   if not isinstance(window, int):
      ...
   ```



##########
python/pyspark/pandas/window.py:
##########
@@ -144,10 +144,15 @@ def __init__(
         window: int,
         min_periods: Optional[int] = None,
     ):
+        if type(window) is not int:
+            raise ValueError("window must be an integer")

Review Comment:
   Can we follow the error message same as pandas ?
   
   ```python
   >>> ps.range(10).to_pandas().rolling(window=1.1)
   Traceback (most recent call last):
   ...
   ValueError: window must be an integer 0 or greater
   ```



-- 
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]

Reply via email to