HyukjinKwon commented on code in PR #37560:
URL: https://github.com/apache/spark/pull/37560#discussion_r948572239


##########
python/pyspark/sql/types.py:
##########
@@ -2256,11 +2256,27 @@ def convert(self, obj: datetime.timedelta, 
gateway_client: GatewayClient) -> Jav
         )
 
 
+class NumpyScalarConverter:
+    def can_convert(self, obj: Any) -> bool:
+        try:
+            import numpy as np

Review Comment:
   Can we cache this variable somewhere? my concern is that it will attempt to 
import for every Py4J access which might downgrade perf



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to