HyukjinKwon commented on code in PR #39360:
URL: https://github.com/apache/spark/pull/39360#discussion_r1060440629
##########
python/pyspark/sql/connect/session.py:
##########
@@ -231,13 +231,21 @@ def createDataFrame(
_schema.fields[i].name = name
_schema.names[i] = name
- pdf = pd.DataFrame(_data)
-
if _cols is None:
- _cols = ["_%s" % i for i in range(1, pdf.shape[1] + 1)]
+ if _schema is None:
+ _cols = ["_%s" % i for i in range(1, len(_data[0]) + 1)]
+ else:
+ _cols = _schema.names
+
+ if isinstance(_data[0], Row):
+ table = pa.Table.from_pylist([row.asDict() for row in _data])
Review Comment:
Should probably call `row.asDict(recursive=True)`
--
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]