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



##########
File path: python/pyspark/pandas/namespace.py
##########
@@ -2480,6 +2531,7 @@ def isna(obj):
 isnull = isna
 
 
+@no_type_check

Review comment:
       These could be used as a udf for `transform` or other functions, 
although usually it shouldn't happen.
   In that case, it has to know the return type but if there is a return type 
annotation, it can't infer the return type.

##########
File path: python/pyspark/pandas/utils.py
##########
@@ -600,7 +600,7 @@ def column_labels_level(column_labels: List[Tuple]) -> int:
         return list(levels)[0]
 
 
-def name_like_string(name: Optional[Union[str, Tuple]]) -> str:
+def name_like_string(name: Optional[Union[Any, Tuple]]) -> str:

Review comment:
       Good point!
   Actually `str` here was a mistake because the `name` in pandas-on-Spark can 
be non-string values, like `int`, `float`, etc., and `mypy` reported an error.

##########
File path: python/pyspark/pandas/utils.py
##########
@@ -600,7 +600,7 @@ def column_labels_level(column_labels: List[Tuple]) -> int:
         return list(levels)[0]
 
 
-def name_like_string(name: Optional[Union[str, Tuple]]) -> str:
+def name_like_string(name: Optional[Union[Any, Tuple]]) -> str:

Review comment:
       Good point!
   Actually `str` here was a mistake because the `name` in pandas-on-Spark can 
be non-string values, like `int`, `float`, etc., and `mypy` reported an error 
in the `namespace.py`.




-- 
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:
us...@infra.apache.org



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

Reply via email to