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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org