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

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

Maciej Szymkiewicz created SPARK-32814:
------------------------------------------

             Summary: 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: 3.0.0, 2.4.0, 3.1.0
            Reporter: Maciej Szymkiewicz


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