HyukjinKwon commented on a change in pull request #23357: [SPARK-26451][SQL] 
Change lead/lag argument name from count to offset
URL: https://github.com/apache/spark/pull/23357#discussion_r244174629
 
 

 ##########
 File path: python/pyspark/sql/functions.py
 ##########
 @@ -798,7 +798,7 @@ def factorial(col):
 # ---------------  Window functions ------------------------
 
 @since(1.4)
-def lag(col, count=1, default=None):
+def lag(col, offset=1, default=None):
 
 Review comment:
   Ah, then, we can:
   
   ```python
   from pyspark import _NoValue
   
   def lag(col, offset=_NoValue, default=None, count=_NoValue):
       value = 1
       if count is not _NoValue:
           warnings.warn("'count' is deprecated in 3.0. Use 'offset' instead.", 
DeprecationWarning)
           value = count
       offset = offset if offset is not _NoValue else value
   ```
   
   IIRC, there's few more cases like this. I don't super feel strongly about it 
too but I just wanted to be a bit more conservative to avoid to make this as an 
example.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to