You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/11/23 05:00:45 UTC
[GitHub] [spark] HyukjinKwon commented on a diff in pull request #38757: [SPARK-41222][CONNECT][PYTHON] Unify the typing definitions
HyukjinKwon commented on code in PR #38757:
URL: https://github.com/apache/spark/pull/38757#discussion_r1030022065
##########
python/pyspark/sql/connect/column.py:
##########
@@ -15,14 +15,15 @@
# limitations under the License.
#
import uuid
-from typing import cast, get_args, TYPE_CHECKING, Callable, Any
+from typing import cast, TYPE_CHECKING, Callable, Any
import json
import decimal
import datetime
import pyspark.sql.connect.proto as proto
-from pyspark.sql.connect._typing import PrimitiveType
+
+primitive_types = (bool, float, int, str)
Review Comment:
You can import this in the function in that case. e.g.)
```diff
def _bin_op(
name: str, doc: str = "binary function", reverse: bool = False
) -> Callable[["Column", Any], "Expression"]:
+ from pyspark.sql.connect._typing import PrimitiveType
def _(self: "Column", other: Any) -> "Expression":
```
--
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