You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2020/09/16 11:23:00 UTC

[jira] [Resolved] (SPARK-32814) Metaclasses are broken for a few classes in Python 3

     [ https://issues.apache.org/jira/browse/SPARK-32814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon resolved SPARK-32814.
----------------------------------
    Fix Version/s: 3.1.0
       Resolution: Fixed

Issue resolved by pull request 29664
[https://github.com/apache/spark/pull/29664]

> Metaclasses are broken for a few classes in Python 3
> ----------------------------------------------------
>
>                 Key: SPARK-32814
>                 URL: https://issues.apache.org/jira/browse/SPARK-32814
>             Project: Spark
>          Issue Type: Bug
>          Components: ML, PySpark, SQL
>    Affects Versions: 2.4.0, 3.0.0, 3.1.0
>            Reporter: Maciej Szymkiewicz
>            Assignee: Maciej Szymkiewicz
>            Priority: Major
>             Fix For: 3.1.0
>
>
> As of Python 3 {{__metaclass__}} is no longer supported https://www.python.org/dev/peps/pep-3115/.
> However, we have multiple classes which where never migrated to Python 3 compatible syntax:
> - A number of ML {{Params}}} with {{__metaclass__ = ABCMeta}}
> - Some of the SQL {{types}} with {{__metaclass__ = DataTypeSingleton}}
> As a result some functionalities are broken in Python 3. For example 
> {code:python}
> >>> from pyspark.sql.types import BooleanType                                                                                                                                                                      
> >>> BooleanType() is BooleanType()                                                                                                                                                                                 
> False
> {code}
> or
> {code:python}
> >>> import inspect                                                                                                                                                                                                 
> >>> from pyspark.ml import Estimator                                                                                                                                                                               
> >>> inspect.isabstract(Estimator)                                                                                                                                                                                  
> False
> {code}
> where in both cases we expect to see {{True}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org