ianmcook commented on code in PR #46529:
URL: https://github.com/apache/spark/pull/46529#discussion_r1610533202
##########
python/pyspark/sql/connect/session.py:
##########
@@ -561,6 +568,28 @@ def createDataFrame(
cast(StructType, _deduplicate_field_names(schema)).names
).cast(arrow_schema)
+ elif isinstance(data, pa.Table):
+ prefer_timestamp_ntz = is_timestamp_ntz_preferred()
+
+ (timezone,) =
self._client.get_configs("spark.sql.session.timeZone")
+
+ # If no schema supplied by user then get the names of columns only
+ if schema is None:
+ _cols = data.column_names
+ if isinstance(schema, (list, tuple)) and cast(int, _num_cols) <
len(data.columns):
Review Comment:
This is borrowed directly from the pandas section above (line 516). I would
be happy to open a subsequent PR to try to deduplicate the logic and make it
clearer.
--
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]