Skip to content

Commit

Permalink
Better deprecated docs for estimator/transfomer read/write context fu…
Browse files Browse the repository at this point in the history
…nction.
  • Loading branch information
yanboliang committed Nov 19, 2016
1 parent 7beb568 commit 36c2e24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private[util] sealed trait BaseReadWrite {
* Sets the Spark SQLContext to use for saving/loading.
*/
@Since("1.6.0")
@deprecated("Use session instead", "2.0.0")
@deprecated("Use session instead, This method will be removed in 2.2.0.", "2.0.0")
def context(sqlContext: SQLContext): this.type = {
optionSparkSession = Option(sqlContext.sparkSession)
this
Expand Down
10 changes: 8 additions & 2 deletions python/pyspark/ml/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def overwrite(self):
raise NotImplementedError("MLWriter is not yet implemented for type: %s" % type(self))

def context(self, sqlContext):
"""Sets the SQL context to use for saving."""
"""
Sets the SQL context to use for saving.
.. note:: Deprecated in 2.1, use session instead.
"""
raise NotImplementedError("MLWriter is not yet implemented for type: %s" % type(self))

def session(self, sparkSession):
Expand Down Expand Up @@ -168,7 +171,10 @@ def load(self, path):
raise NotImplementedError("MLReader is not yet implemented for type: %s" % type(self))

def context(self, sqlContext):
"""Sets the SQL context to use for loading."""
"""
Sets the SQL context to use for loading.
.. note:: Deprecated in 2.1, use session instead.
"""
raise NotImplementedError("MLReader is not yet implemented for type: %s" % type(self))

def session(self, sparkSession):
Expand Down

0 comments on commit 36c2e24

Please sign in to comment.