amaliujia commented on code in PR #38409:
URL: https://github.com/apache/spark/pull/38409#discussion_r1009013217
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -305,8 +308,12 @@ def _print_plan(self) -> str:
return self._plan.print()
return ""
- def collect(self) -> None:
- raise NotImplementedError("Please use toPandas().")
+ def collect(self) -> List[Row]:
+ pdf = self.toPandas()
Review Comment:
It is because the returned data batch might not contain a `schema`, and the
python client implementation uses create Pandas from the data batch (e.g. JSON
batch).
If we always include a schema in the data batch, we could drop this
`optional`. I am not familiar enough on Pandas for how to append dtypes to the
DataFrame from PySpark sql StructType though.
--
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]