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

    https://github.com/apache/spark/pull/12398#discussion_r61992184
  
    --- Diff: python/pyspark/tests.py ---
    @@ -1947,6 +1947,33 @@ def test_with_stop(self):
                 sc.stop()
             self.assertEqual(SparkContext._active_spark_context, None)
     
    +    def test_add_py_package(self):
    +        name = "test_tmp"
    +        try:
    +            os.mkdir(name)
    +            with open(os.path.join(name, "__init__.py"), 'w+') as temp:
    +                temp.write("triple = lambda x: 3*x")
    +            pkg = __import__(name)
    +            with SparkContext() as sc:
    +                #trips = sc.parallelize([0, 1, 2, 3]).map(test_tmp.triple)
    +                #sc.addPyPackage(pkg)
    +                trips = sc.parallelize([0, 1, 2, 3]).map(lambda x: 
pkg.triple(x))
    +                self.assertSequenceEqual([0, 3, 6, 9], trips.collect())
    +        finally:
    +            shutil.rmtree(name)
    +        
    --- End diff --
    
    remove the extra empty line


---
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