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_r335145385
 
 

 ##########
 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 this change. At least 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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to