zeruibao commented on code in PR #53314:
URL: https://github.com/apache/spark/pull/53314#discussion_r2586850105


##########
python/pyspark/sql/streaming/stateful_processor_api_client.py:
##########
@@ -501,6 +501,11 @@ def normalize_value(v: Any) -> Any:
                 # Convert NumPy types to Python primitive types.
                 if isinstance(v, np.generic):
                     return v.tolist()
+                # Named tuples (collections.namedtuple or typing.NamedTuple) 
have a
+                # _fields attribute. Spark Row has __fields__. Both require 
positional
+                # arguments and cannot be instantiated with a generator 
expression.
+                if hasattr(v, '_fields') or hasattr(v, '__fields__'):

Review Comment:
   sounds good! You are so fast. Did not get a chance to add a UT yet 😛 just 
convert to draft.



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