From c98042bd56a4eeb980febe887dd26430337e1909 Mon Sep 17 00:00:00 2001 From: Shixiong Zhu Date: Sat, 5 Mar 2016 15:55:05 -0800 Subject: [PATCH] Add a unit test --- python/pyspark/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py index 23720502a82c8..a5a83c7e38b3c 100644 --- a/python/pyspark/tests.py +++ b/python/pyspark/tests.py @@ -228,6 +228,12 @@ def test_itemgetter(self): getter2 = ser.loads(ser.dumps(getter)) self.assertEqual(getter(d), getter2(d)) + def test_function_module_name(self): + ser = CloudPickleSerializer() + func = lambda x: x + func2 = ser.loads(ser.dumps(func)) + self.assertEqual(func.__module__, func2.__module__) + def test_attrgetter(self): from operator import attrgetter ser = CloudPickleSerializer()