Skip to content

Commit

Permalink
[SPARK-3417] Use new-style classes in PySpark
Browse files Browse the repository at this point in the history
Tiny PR making SQLContext a new-style class.  This allows various type logic to work more effectively

```Python
In [1]: import pyspark

In [2]: pyspark.sql.SQLContext.mro()
Out[2]: [pyspark.sql.SQLContext, object]
```

Author: Matthew Rocklin <mrocklin@gmail.com>

Closes apache#2288 from mrocklin/sqlcontext-new-style-class and squashes the following commits:

4aadab6 [Matthew Rocklin] update other old-style classes
a2dc02f [Matthew Rocklin] pyspark.sql.SQLContext is new-style class
  • Loading branch information
mrocklin authored and marmbrus committed Sep 8, 2014
1 parent 26bc765 commit 939a322
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/pyspark/mllib/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
__all__ = ['RandomRDDs', ]


class RandomRDDs:
class RandomRDDs(object):
"""
Generator methods for creating RDDs comprised of i.i.d samples from
some distribution.
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/mllib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from pyspark.serializers import NoOpSerializer


class MLUtils:
class MLUtils(object):

"""
Helper methods to load, save and pre-process data used in MLlib.
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def __reduce__(self):
return Row


class SQLContext:
class SQLContext(object):

"""Main entry point for Spark SQL functionality.
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/storagelevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__all__ = ["StorageLevel"]


class StorageLevel:
class StorageLevel(object):

"""
Flags for controlling the storage of an RDD. Each StorageLevel records whether to use memory,
Expand Down

0 comments on commit 939a322

Please sign in to comment.