Skip to content

Commit

Permalink
BUG: Fixed other parsing method instances to pass BAD_REQUEST
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Batomunkuev <abatomunkuev@myseneca.ca>
  • Loading branch information
abatomunkuev committed Nov 18, 2021
1 parent 18e0d2c commit ceca430
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mlflow/pyfunc/scoring_server/__init__.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -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,
)


Expand All @@ -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,
)


Expand All @@ -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,
)


Expand All @@ -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,
)


Expand Down

0 comments on commit ceca430

Please sign in to comment.