Github user wesm commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19884#discussion_r155647741
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -1658,13 +1657,13 @@ def from_arrow_type(at):
             spark_type = FloatType()
         elif at == pa.float64():
             spark_type = DoubleType()
    -    elif type(at) == pa.DecimalType:
    +    elif pa.types.is_decimal(at):
             spark_type = DecimalType(precision=at.precision, scale=at.scale)
    -    elif at == pa.string():
    +    elif pa.types.is_string(at):
             spark_type = StringType()
         elif at == pa.date32():
             spark_type = DateType()
    -    elif type(at) == pa.TimestampType:
    +    elif pa.types.is_timestamp(at):
    --- End diff --
    
    Yep, this is right. I'm opening a JIRA to add more functions for testing 
exact types


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to