aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/mllib/__init__.py
diff options
context:
space:
mode:
authorJoseph K. Bradley <joseph@databricks.com>2014-12-17 14:12:46 -0800
committerXiangrui Meng <meng@databricks.com>2014-12-17 14:12:46 -0800
commitaffc3f460fc6172b6cea88a8779d6d40166c1c6b (patch)
tree4fc2052583c84f5b29a15ac6403e9b0589057599 /python/pyspark/mllib/__init__.py
parent636d9fc450faaa0d8e82e0d34bb7b791e3812cb7 (diff)
downloadspark-affc3f460fc6172b6cea88a8779d6d40166c1c6b.tar.gz
spark-affc3f460fc6172b6cea88a8779d6d40166c1c6b.tar.bz2
spark-affc3f460fc6172b6cea88a8779d6d40166c1c6b.zip
[SPARK-4821] [mllib] [python] [docs] Fix for pyspark.mllib.rand doc
+ small doc edit + include edit to make IntelliJ happy CC: davies mengxr Note to davies -- this does not fix the "WARNING: Literal block expected; none found." warnings since that seems to involve spacing which IntelliJ does not like. (Those warnings occur when generating the Python docs.) Author: Joseph K. Bradley <joseph@databricks.com> Closes #3669 from jkbradley/python-warnings and squashes the following commits: 4587868 [Joseph K. Bradley] fixed warning 8cb073c [Joseph K. Bradley] Updated based on davies recommendation c51eca4 [Joseph K. Bradley] Updated rst file for pyspark.mllib.rand doc. Small doc edit. Small include edit to make IntelliJ happy.
Diffstat (limited to 'python/pyspark/mllib/__init__.py')
-rw-r--r--python/pyspark/mllib/__init__.py27
1 files changed, 1 insertions, 26 deletions
diff --git a/python/pyspark/mllib/__init__.py b/python/pyspark/mllib/__init__.py
index 5030a655fc..c3217620e3 100644
--- a/python/pyspark/mllib/__init__.py
+++ b/python/pyspark/mllib/__init__.py
@@ -32,29 +32,4 @@ import sys
import rand as random
random.__name__ = 'random'
random.RandomRDDs.__module__ = __name__ + '.random'
-
-
-class RandomModuleHook(object):
- """
- Hook to import pyspark.mllib.random
- """
- fullname = __name__ + '.random'
-
- def find_module(self, name, path=None):
- # skip all other modules
- if not name.startswith(self.fullname):
- return
- return self
-
- def load_module(self, name):
- if name == self.fullname:
- return random
-
- cname = name.rsplit('.', 1)[-1]
- try:
- return getattr(random, cname)
- except AttributeError:
- raise ImportError
-
-
-sys.meta_path.append(RandomModuleHook())
+sys.modules[__name__ + '.random'] = random