You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "itholic (via GitHub)" <gi...@apache.org> on 2023/03/03 19:23:38 UTC

[GitHub] [spark] itholic commented on a diff in pull request #40271: [WIP][SPARK-42258][PYTHON] pyspark.sql.functions should not expose typing.cast

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


##########
python/pyspark/sql/functions.py:
##########
@@ -22,20 +22,10 @@
 import sys
 import functools
 import warnings
-from typing import (
-    Any,
-    cast,

Review Comment:
   How about just fix the `cast` instead of fixing all imports and add a test to verify it ??
   
   IMHO most of the other functions except `cast` seem to be names that are very unlikely to be used repeatedly.
   
   Another concern is that we're using the typing module most of our PySpark files this way, so I don't know maybe if we need to fix all the other files for consistency(but which seems to be too much work).
   
   ```shell
   spark$ git grep "from typing import" python/pyspark | wc -l
        202
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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