Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/19792#discussion_r155424467
--- Diff: python/pyspark/sql/session.py ---
@@ -405,14 +401,9 @@ def _createFromLocal(self, data, schema):
data = list(data)
if schema is None or isinstance(schema, (list, tuple)):
- struct = self._inferSchemaFromList(data)
- converter = _create_converter(struct)
+ schema = self._inferSchemaFromList(data, names=schema)
+ converter = _create_converter(schema)
data = map(converter, data)
- if isinstance(schema, (list, tuple)):
--- End diff --
```python
>>> spark.createDataFrame([{'a': 1}], ["b"])
DataFrame[a: bigint]
```
Hm.. sorry actually I think we should not remove this one and L385 because
we should primarily respect user's input and it should be `DataFrame[b:
bigint]`.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]