spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zero323 <...@git.apache.org>
Subject [GitHub] spark pull request #16536: [SPARK-19163][PYTHON][SQL] Delay _judf initializa...
Date Thu, 26 Jan 2017 21:16:21 GMT
Github user zero323 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16536#discussion_r98093311
  
    --- Diff: python/pyspark/sql/tests.py ---
    @@ -476,6 +476,19 @@ def test_udf_defers_judf_initalization(self):
                 "judf should be initialized after UDF has been called."
             )
     
    +    @unittest.skipIf(sys.version_info < (3, 3), "Unittest < 3.3 doesn't support
mocking")
    --- End diff --
    
    ```python
    class UDFInitializationTestCase(unittest.TestCase):
        def tearDown(self):
            if SparkSession._instantiatedSession is not None:
                SparkSession._instantiatedSession.stop()
    
            if SparkContext._active_spark_context is not None:
                SparkContext._active_spark_contex.stop()
    
        def test_udf_context_access(self):
            from pyspark.sql.functions import UserDefinedFunction
            f = UserDefinedFunction(lambda x: x, StringType())
            self.assertIsNone(SparkContext._active_spark_context)
            self.assertIsNone(SparkSession._instantiatedSession)
                
    ```



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message