You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a BentoML service that serves whisper, and when upgrading our codebase to pydantic 2.x I think I ran into a bug in BentoML's parsing of pydantic models into OpenAPI spec.
For the return type of my endpoint, I have a pydantic class in which some fields are named tuples from another library (such as this).
When trying to build the docker image, while the OpenAPI spec is created, I get the error:
File "/Users/dcferreira/projects/other/bentoml_openapi_example/.venv/lib/python3.11/site-packages/_bentoml_sdk/io_models.py", line 97, in <dictcomp>
components.update({k: Schema(**v) for k, v in defs.items()})
^^^^^^^^^^^
TypeError: Schema.__init__() got an unexpected keyword argument 'prefixItems'
I believe this is the same issue as in this other library, where this prefixItems is a new thing in the OpenAPI spec.
This was working with pydantic 1.10.
Describe the bug
I have a BentoML service that serves whisper, and when upgrading our codebase to pydantic 2.x I think I ran into a bug in BentoML's parsing of pydantic models into OpenAPI spec.
For the return type of my endpoint, I have a pydantic class in which some fields are named tuples from another library (such as this).
When trying to build the docker image, while the OpenAPI spec is created, I get the error:
I believe this is the same issue as in this other library, where this
prefixItems
is a new thing in the OpenAPI spec.This was working with pydantic 1.10.
To reproduce
service.py
bentoml serve service:HelloWorld
As an alternative, you can replace steps 2-4 with running
bentoml build .
if you use thisbentofile.yaml
If you remove the
tuple2
from the pydantic class above, everything works as expected.Expected behavior
No response
Environment
Environment variable
System information
bentoml
: 1.2.12python
: 3.11.4platform
: macOS-14.4.1-arm64-arm-64bituid_gid
: 501:20pip_packages
The text was updated successfully, but these errors were encountered: