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: [email protected]
For additional commands, e-mail: [email protected]