Skip to content

Commit

Permalink
[SPARK-14768][ML][PYSPARK] removed expectedType from Param __init__()
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?
Removed expectedType arg from PySpark Param __init__, as suggested by the JIRA.

## How was this patch tested?
Manually looked through all places that use Param. Compiled and ran all ML PySpark test cases before and after the fix.

Author: Jason Lee <cjlee@us.ibm.com>

Closes #12581 from jasoncl/SPARK-14768.
  • Loading branch information
jasoncl authored and Nick Pentreath committed Apr 25, 2016
1 parent e66afd5 commit bfda099
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions python/pyspark/ml/param/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,15 @@ class Param(object):
"""
A param with self-contained documentation.
Note: `expectedType` is deprecated and will be removed in 2.1. Use typeConverter instead,
as a keyword argument.
.. versionadded:: 1.3.0
"""

def __init__(self, parent, name, doc, expectedType=None, typeConverter=None):
def __init__(self, parent, name, doc, typeConverter=None):
if not isinstance(parent, Identifiable):
raise TypeError("Parent must be an Identifiable but got type %s." % type(parent))
self.parent = parent.uid
self.name = str(name)
self.doc = str(doc)
self.expectedType = expectedType
if expectedType is not None:
warnings.warn("expectedType is deprecated and will be removed in 2.1. " +
"Use typeConverter instead, as a keyword argument.")
self.typeConverter = TypeConverters.identity if typeConverter is None else typeConverter

def _copy_new_parent(self, parent):
Expand Down

0 comments on commit bfda099

Please sign in to comment.