-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-4348] [PySpark] [MLlib] rename random.py to rand.py #3216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
cc @JoshRosen |
|
Test build #23237 has started for PR 3216 at commit
|
|
Test build #23237 has finished for PR 3216 at commit
|
|
Test PASSed. |
|
@davies I tried the following but failed: This doesn't work either: I'm using IPython 2.1.0 with Python 2.7.8. |
|
It works for me: Could you try to import |
|
It seems that I cannot import anything under mllib: |
|
It works for me as well. |
|
It turned out I had a folder called This looks good to me. |
|
Merged into master and branch-1.2. Thanks! |
This PR rename random.py to rand.py to avoid the side affects of conflict with random module, but still keep the same interface as before.
```
>>> from pyspark.mllib.random import RandomRDDs
```
```
$ pydoc pyspark.mllib.random
Help on module random in pyspark.mllib:
NAME
random - Python package for random data generation.
FILE
/Users/davies/work/spark/python/pyspark/mllib/rand.py
CLASSES
__builtin__.object
pyspark.mllib.random.RandomRDDs
class RandomRDDs(__builtin__.object)
| Generator methods for creating RDDs comprised of i.i.d samples from
| some distribution.
|
| Static methods defined here:
|
| normalRDD(sc, size, numPartitions=None, seed=None)
```
cc mengxr
reference link: http://xion.org.pl/2012/05/06/hacking-python-imports/
Author: Davies Liu <davies@databricks.com>
Closes #3216 from davies/random and squashes the following commits:
7ac4e8b [Davies Liu] rename random.py to rand.py
(cherry picked from commit ce0333f)
Signed-off-by: Xiangrui Meng <meng@databricks.com>
This PR rename random.py to rand.py to avoid the side affects of conflict with random module, but still keep the same interface as before.
```
>>> from pyspark.mllib.random import RandomRDDs
```
```
$ pydoc pyspark.mllib.random
Help on module random in pyspark.mllib:
NAME
random - Python package for random data generation.
FILE
/Users/davies/work/spark/python/pyspark/mllib/rand.py
CLASSES
__builtin__.object
pyspark.mllib.random.RandomRDDs
class RandomRDDs(__builtin__.object)
| Generator methods for creating RDDs comprised of i.i.d samples from
| some distribution.
|
| Static methods defined here:
|
| normalRDD(sc, size, numPartitions=None, seed=None)
```
cc mengxr
reference link: http://xion.org.pl/2012/05/06/hacking-python-imports/
Author: Davies Liu <davies@databricks.com>
Closes apache#3216 from davies/random and squashes the following commits:
7ac4e8b [Davies Liu] rename random.py to rand.py
(cherry picked from commit ce0333f)
Signed-off-by: Josh Rosen <joshrosen@databricks.com>
Conflicts:
python/pyspark/mllib/feature.py
python/run-tests
…o branch-1.1 This backports #3216 and #3669 to `branch-1.1` in order to fix the PySpark unit tests. Author: Joseph K. Bradley <joseph@databricks.com> Author: Davies Liu <davies@databricks.com> Closes #4011 from JoshRosen/pyspark-rand-fix-1.1-backport and squashes the following commits: ace4cb6 [Joseph K. Bradley] [SPARK-4821] [mllib] [python] [docs] Fix for pyspark.mllib.rand doc 7ae5a1c [Davies Liu] [SPARK-4348] [PySpark] [MLlib] rename random.py to rand.py
This PR rename random.py to rand.py to avoid the side affects of conflict with random module, but still keep the same interface as before.
cc @mengxr
reference link: http://xion.org.pl/2012/05/06/hacking-python-imports/