Yikun Jiang created SPARK-41186: ----------------------------------- Summary: Fix doctest for new version mlfow Key: SPARK-41186 URL: https://issues.apache.org/jira/browse/SPARK-41186 Project: Spark Issue Type: Bug Components: Tests Affects Versions: 3.4.0 Reporter: Yikun Jiang
********************************************************************** File "/__w/spark/spark/python/pyspark/pandas/mlflow.py", line 168, in pyspark.pandas.mlflow.load_model Failed example: run_info = client.list_run_infos(exp_id)[-1] Exception raised: Traceback (most recent call last): File "/usr/lib/python3.9/doctest.py", line 1336, in __run exec(compile(example.source, filename, "single", File "<doctest pyspark.pandas.mlflow.load_model[14]>", line 1, in <module> run_info = client.list_run_infos(exp_id)[-1] AttributeError: 'MlflowClient' object has no attribute 'list_run_infos' ********************************************************************** File "/__w/spark/spark/python/pyspark/pandas/mlflow.py", line 169, in pyspark.pandas.mlflow.load_model Failed example: model = load_model("runs:/{run_id}/model".format(run_id=run_info.run_uuid)) Exception raised: Traceback (most recent call last): File "/usr/lib/python3.9/doctest.py", line 1336, in __run exec(compile(example.source, filename, "single", File "<doctest pyspark.pandas.mlflow.load_model[15]>", line 1, in <module> model = load_model("runs:/{run_id}/model".format(run_id=run_info.run_uuid)) NameError: name 'run_info' is not defined ********************************************************************** File "/__w/spark/spark/python/pyspark/pandas/mlflow.py", line 171, in pyspark.pandas.mlflow.load_model Failed example: prediction_df["prediction"] = model.predict(prediction_df) Exception raised: Traceback (most recent call last): File "/usr/lib/python3.9/doctest.py", line 1336, in __run exec(compile(example.source, filename, "single", File "<doctest pyspark.pandas.mlflow.load_model[17]>", line 1, in <module> prediction_df["prediction"] = model.predict(prediction_df) NameError: name 'model' is not defined ********************************************************************** File "/__w/spark/spark/python/pyspark/pandas/mlflow.py", line 172, in pyspark.pandas.mlflow.load_model Failed example: prediction_df Expected: x1 x2 prediction 0 2.0 4.0 1.355551 Got: x1 x2 0 2.0 4.0 ********************************************************************** File "/__w/spark/spark/python/pyspark/pandas/mlflow.py", line 178, in pyspark.pandas.mlflow.load_model Failed example: model.predict(prediction_df[["x1", "x2"]].to_pandas()) Exception raised: Traceback (most recent call last): File "/usr/lib/python3.9/doctest.py", line 1336, in __run exec(compile(example.source, filename, "single", File "<doctest pyspark.pandas.mlflow.load_model[19]>", line 1, in <module> model.predict(prediction_df[["x1", "x2"]].to_pandas()) NameError: name 'model' is not defined ********************************************************************** File "/__w/spark/spark/python/pyspark/pandas/mlflow.py", line 189, in pyspark.pandas.mlflow.load_model Failed example: y = model.predict(features) Exception raised: Traceback (most recent call last): File "/usr/lib/python3.9/doctest.py", line 1336, in __run exec(compile(example.source, filename, "single", File "<doctest pyspark.pandas.mlflow.load_model[22]>", line 1, in <module> y = model.predict(features) NameError: name 'model' is not defined ********************************************************************** File "/__w/spark/spark/python/pyspark/pandas/mlflow.py", line 198, in pyspark.pandas.mlflow.load_model Failed example: features['y'] = y Exception raised: Traceback (most recent call last): File "/usr/lib/python3.9/doctest.py", line 1336, in __run exec(compile(example.source, filename, "single", File "<doctest pyspark.pandas.mlflow.load_model[25]>", line 1, in <module> features['y'] = y NameError: name 'y' is not defined ********************************************************************** File "/__w/spark/spark/python/pyspark/pandas/mlflow.py", line 200, in pyspark.pandas.mlflow.load_model Failed example: everything Expected: x1 x2 z y 0 2.0 3.0 -1 1.376932 Got: x1 x2 z 0 2.0 3.0 -1 ********************************************************************** 8 of 26 in pyspark.pandas.mlflow.load_model -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org