You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2022/01/17 03:15:17 UTC

[spark] branch master updated: [SPARK-36885][PYTHON][FOLLOWUP] Fix drop subset inline type hint

This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 17aaf8e  [SPARK-36885][PYTHON][FOLLOWUP] Fix drop subset inline type hint
17aaf8e is described below

commit 17aaf8ed29e24516ca460d92b481a0b2f0545ddf
Author: Yikun Jiang <yi...@gmail.com>
AuthorDate: Mon Jan 17 12:14:30 2022 +0900

    [SPARK-36885][PYTHON][FOLLOWUP] Fix drop subset inline type hint
    
    ### What changes were proposed in this pull request?
    Fix drop subset inline type hint
    
    ### Why are the changes needed?
    it should be same with `DataFrame.dropna`:
    https://github.com/apache/spark/blob/90003398745bfee78416074ed786e986fcb2c8cd/python/pyspark/sql/dataframe.py#L2359
    
    See also: https://github.com/apache/spark/pull/35191#discussion_r784446470
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    UT
    
    Closes #35201 from Yikun/SPARK-36885-FOLLOWUP.
    
    Authored-by: Yikun Jiang <yi...@gmail.com>
    Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
 python/pyspark/sql/dataframe.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py
index 9e75006..ee68865 100644
--- a/python/pyspark/sql/dataframe.py
+++ b/python/pyspark/sql/dataframe.py
@@ -3310,7 +3310,10 @@ class DataFrameNaFunctions:
         self.df = df
 
     def drop(
-        self, how: str = "any", thresh: Optional[int] = None, subset: Optional[List[str]] = None
+        self,
+        how: str = "any",
+        thresh: Optional[int] = None,
+        subset: Optional[Union[str, Tuple[str, ...], List[str]]] = None,
     ) -> DataFrame:
         return self.df.dropna(how=how, thresh=thresh, subset=subset)
 

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