| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Co-authored-by: Stefan Borer <stefan.borer@gmail.com>
Change imports Undefined => PydanticUndefined Update SQLModelMetaclass and SQLModel __init__ and __new__ functions Update SQL Alchemy type inference
Only need to fix OPEN API things I think
|
📝 Docs preview for commit e2d4d1f at: https://003fc64c.sqlmodel.pages.dev |
Sorry, something went wrong.
|
Hey, we're currently investigating to use SQLModel in Willow Application Server. As we're doing some latency sensitive stuff in there, we'd really like to use Pydantic 2, so I gave this PR a try. Creating a table and inserting records seems to work, but when trying a select we hit the following exception: [2023-11-30T17:41:05] ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 426, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 292, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 122, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 184, in __call__
raise exc
File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 83, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
raise exc
File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.12/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
raise e
File "/usr/local/lib/python3.12/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 718, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
return await dependant.call(**values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/app/routers/config.py", line 57, in api_get_config
config = get_config_from_db_pydantic()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/app/internal/was.py", line 117, in get_config_from_db_pydantic
statement = select(ConfigTablePydantic).where(ConfigTablePydantic.config_type == "config")
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/sqlmodel/sql/expression.py", line 429, in select
return SelectOfScalar._create(*entities, **kw) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'SelectOfScalar' has no attribute '_create'. Did you mean: '_correlate'?
I understand this is a WIP, so my question is: do you have a rough estimate of when this would be ready? |
Sorry, something went wrong.
Sorry, something went wrong.
|
Thank you for your work @AntonDeMeester! I included your commits in #722 (you can see your badge now says "Contributor" 😎 ), I changed a few extra things, more details in that PR. It's now released and available as SQLModel 0.0.14! 🎉 🌮 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Upgrades to Pydantic 2, using the new pydantic models. This also includes support for Pydantic v1.