moskvax commented on a change in pull request #28743:
URL: https://github.com/apache/spark/pull/28743#discussion_r438840313
##########
File path: python/pyspark/sql/pandas/conversion.py
##########
@@ -394,10 +394,11 @@ def _create_from_pandas_with_arrow(self, pdf, schema,
timezone):
# Create the Spark schema from list of names passed in with Arrow types
if isinstance(schema, (list, tuple)):
- arrow_schema = pa.Schema.from_pandas(pdf, preserve_index=False)
+ inferred_types = [pa.infer_type(s, mask=s.isna(), from_pandas=True)
Review comment:
> For the second case above, so `pa.Schema.from_pandas` returns correct
types in the case? When `pa.infer_type` infers the specified array types, will
it just throw error or return a wrong array type?
`pa.infer_type` will throw an error for these arrays.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]