From 97d3a718bf5e8fa523be300871caecbdb24bb8fd Mon Sep 17 00:00:00 2001 From: Andrei Batomunkuev Date: Mon, 22 Nov 2021 20:52:16 -0500 Subject: [PATCH] BUG: updated all instances from MALFORMED_REQUEST to BAD_REQUEST Signed-off-by: Andrei Batomunkuev --- mlflow/pyfunc/scoring_server/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mlflow/pyfunc/scoring_server/__init__.py b/mlflow/pyfunc/scoring_server/__init__.py index 0a2de58354474..314a0a9500922 100644 --- a/mlflow/pyfunc/scoring_server/__init__.py +++ b/mlflow/pyfunc/scoring_server/__init__.py @@ -39,7 +39,7 @@ from mlflow.pyfunc import load_model, PyFuncModel except ImportError: from mlflow.pyfunc import load_pyfunc as load_model -from mlflow.protos.databricks_pb2 import MALFORMED_REQUEST, BAD_REQUEST +from mlflow.protos.databricks_pb2 import BAD_REQUEST from mlflow.server.handlers import catch_mlflow_exception try: @@ -96,7 +96,7 @@ def infer_and_parse_json_input(json_input, schema: Schema = None): return parse_tf_serving_input(decoded_input, schema=schema) except MlflowException as ex: _handle_serving_error( - error_message=(ex.message), error_code=MALFORMED_REQUEST, + error_message=(ex.message), error_code=BAD_REQUEST, ) else: return parse_json_input(json_input=json_input, orient="split", schema=schema) @@ -106,7 +106,7 @@ def infer_and_parse_json_input(json_input, schema: Schema = None): "Failed to parse input from JSON. Ensure that input is a valid JSON" " list or dictionary." ), - error_code=MALFORMED_REQUEST, + error_code=BAD_REQUEST, ) @@ -129,7 +129,7 @@ def parse_json_input(json_input, orient="split", schema: Schema = None): " produced using the `pandas.DataFrame.to_json(..., orient='{orient}')`" " method.".format(orient=orient) ), - error_code=MALFORMED_REQUEST, + error_code=BAD_REQUEST, ) @@ -148,7 +148,7 @@ def parse_csv_input(csv_input): " a valid CSV-formatted Pandas DataFrame produced using the" " `pandas.DataFrame.to_csv()` method." ), - error_code=MALFORMED_REQUEST, + error_code=BAD_REQUEST, ) @@ -173,7 +173,7 @@ def parse_split_oriented_json_input_to_numpy(json_input): " produced using the `pandas.DataFrame.to_json(..., orient='split')`" " method." ), - error_code=MALFORMED_REQUEST, + error_code=BAD_REQUEST, )