khakhlyuk commented on code in PR #52670:
URL: https://github.com/apache/spark/pull/52670#discussion_r2447144128
##########
python/pyspark/sql/connect/session.py:
##########
@@ -578,6 +578,11 @@ def createDataFrame(
spark_type = from_arrow_type(field_type)
struct.add(field.name, spark_type,
nullable=field.nullable)
schema = struct
+ if len(schema) == 0:
Review Comment:
hey @HyukjinKwon!
In spark classic the code does not throw an error
```
df = pd.DataFrame(index=range(5))
spark.createDataFrame(df).collect()
```
this code results in an empty list `[]`. We could add the same error for the
classic spark, but it will be a breaking change technically. Do you think it
makes sense to do that?
--
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]