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


##########
python/pyspark/sql/streaming/state.py:
##########
@@ -130,6 +131,10 @@ def update(self, newValue: Tuple) -> None:
         if newValue is None:
             raise ValueError("'None' is not a valid state value")
 
+        if has_numpy:
+            import numpy as np
+            # In order to convert NumPy types to Python primitive types.
+            newValue = tuple(v.tolist() for v in newValue if isinstance(v, 
np.generic))

Review Comment:
   @xinrong-meng mind reviewing this please?



-- 
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