qudade commented on a change in pull request #26118: [SPARK-24915][PySpark] Fix 
Row handling with Schema.
URL: https://github.com/apache/spark/pull/26118#discussion_r335146265
 
 

 ##########
 File path: python/pyspark/sql/types.py
 ##########
 @@ -599,6 +599,8 @@ def toInternal(self, obj):
             if isinstance(obj, dict):
                 return tuple(f.toInternal(obj.get(n)) if c else obj.get(n)
                              for n, f, c in zip(self.names, self.fields, 
self._needConversion))
+            elif isinstance(obj, Row):
+                return self.toInternal(obj.asDict())
 
 Review comment:
   I added the `and getattr(obj, "__from_dict__", False)`.
   
   In `types.py` there were two places where the same distinction was necessary.
   
   I also added a test to check that RDD-style `Row`s are still processed 
correctly.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to