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

    https://github.com/apache/spark/pull/15843#discussion_r87550799
  
    --- Diff: python/pyspark/ml/wrapper.py ---
    @@ -33,6 +33,10 @@ def __init__(self, java_obj=None):
             super(JavaWrapper, self).__init__()
             self._java_obj = java_obj
     
    +    def __del__(self):
    +        if SparkContext._active_spark_context:
    --- End diff --
    
    checking if there is active spark context, got this error after `quit()` in 
`pyspark`
    ```
    Exception ignored in: <bound method JavaWrapper.__del__ of
    StringIndexer_4a75b9e8c92f56703aff>
    Traceback (most recent call last):
    File "/Users/xx/Project/Spark/python/pyspark/ml/wrapper.py", line
    37, in __del__
    SparkContext._active_spark_context._gateway.detach(self._java_obj)
    AttributeError: 'NoneType' object has no attribute '_gateway'
    Exception ignored in: <bound method JavaWrapper.__del__ of
    StringIndexer_4a75b9e8c92f56703aff>
    Traceback (most recent call last):
    File "/Users/xx/Project/Spark/python/pyspark/ml/wrapper.py", line
    37, in __del__
    AttributeError: 'NoneType' object has no attribute '_gateway'
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to