Skip to content

Commit

Permalink
fix: remove marshmallow deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolopez committed Mar 25, 2024
1 parent b101b68 commit b0dd6a3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions deepaas/api/v2/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

from aiohttp import web
import aiohttp_apispec
import marshmallow
from webargs import aiohttpparser
import webargs.core

Expand All @@ -39,9 +38,7 @@ def _get_handler(model_name, model_obj):
accept = aux.get("accept", None)
if accept:
accept.validate.choices.append("*/*")
# If no default value use first possible choice:
if isinstance(accept.missing, marshmallow.utils._Missing):
accept.missing = accept.validate.choices[0]
accept.load_default = accept.validate.choices[0]
accept.location = "headers"

handler_args = webargs.core.dict2schema(aux)
Expand Down

0 comments on commit b0dd6a3

Please sign in to comment.