zhengruifeng commented on code in PR #47467:
URL: https://github.com/apache/spark/pull/47467#discussion_r1689060192


##########
mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala:
##########
@@ -581,21 +609,33 @@ private[ml] object DefaultParamsReader {
   }
 
   /**
-   * Load metadata saved using [[DefaultParamsWriter.saveMetadata()]]
+   * Load metadata saved using [[DefaultParamsWriter.saveMetadataV2()]]
    *
    * @param expectedClassName  If non empty, this is checked against the 
loaded metadata.
    * @throws IllegalArgumentException if expectedClassName is specified and 
does not match metadata
    */
-  def loadMetadata(path: String, sc: SparkContext, expectedClassName: String = 
""): Metadata = {
+  @deprecated("use loadMetadataV2", "4.0.0")
+  def loadMetadata(path: String, sc: SparkContext, expectedClassName: String = 
""): Metadata =
+    loadMetadataV2(path, 
SparkSession.builder().sparkContext(sc).getOrCreate(), expectedClassName)
+
+  /**
+   * Load metadata saved using [[DefaultParamsWriter.saveMetadataV2()]]
+   *
+   * @param expectedClassName  If non empty, this is checked against the 
loaded metadata.
+   * @throws IllegalArgumentException if expectedClassName is specified and 
does not match metadata
+   */
+  def loadMetadataV2(

Review Comment:
   ~~hmm, probably I can try `sc: Either[SparkContext, SparkSession]`~~



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to