Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
Signed-off-by: Weichen Xu <[email protected]>
  • Loading branch information
WeichenXu123 committed Jul 23, 2024
1 parent 215a204 commit ec7bec0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/pyspark/ml/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def saveMetadata(
instance, sc, extraMetadata, paramMap
)
spark = SparkSession._getActiveSessionOrCreate()
spark.createDataFrame( # type: ignore[union-attr]
spark.createDataFrame(
[(metadataJson,)], schema=["value"]
).coalesce(1).write.text(metadataPath)

Expand Down Expand Up @@ -581,7 +581,7 @@ def loadMetadata(path: str, sc: "SparkContext", expectedClassName: str = "") ->
"""
metadataPath = os.path.join(path, "metadata")
spark = SparkSession._getActiveSessionOrCreate()
metadataStr = spark.read.text(metadataPath).first()[0] # type: ignore[union-attr,index]
metadataStr = spark.read.text(metadataPath).first()[0] # type: ignore[index]
loadedVals = DefaultParamsReader._parseMetaData(metadataStr, expectedClassName)
return loadedVals

Expand Down

0 comments on commit ec7bec0

Please sign in to comment.