zhengruifeng commented on code in PR #52897:
URL: https://github.com/apache/spark/pull/52897#discussion_r2513170432
##########
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:
why is `dtype=object` necessary?
##########
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))
+ for col_data, field in zip(columns_data,
self.schema.fields)
Review Comment:
can we avoid creating `columns_data: list[list]` ?
--
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]