Yicong-Huang commented on code in PR #52897:
URL: https://github.com/apache/spark/pull/52897#discussion_r2515794164


##########
python/pyspark/sql/pandas/conversion.py:
##########
@@ -208,13 +210,15 @@ def toPandas(self) -> "PandasDataFrameLike":
                         ),
                         error_on_duplicated_field_names=False,
                         timestamp_utc_localized=False,
-                    )(pser)
-                    for (_, pser), field in zip(pdf.items(), 
self.schema.fields)
+                    )(pd.Series(col_data, dtype=object))

Review Comment:
   here is building a series to pass to `_create_converter_to_pandas`, which 
will convert the series to the declared type in `field.dataType`. So I think 
the dtype here is optional and unnecessary. If we do not supply `object`, then 
when creating series it will start to infer the type, which will be quite slow.



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