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
if sqlachemy version more then 2.0.0 raised error:
Traceback (most recent call last):
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/examples/api_for_sqlalchemy/main.py", line 23, in <module>
from examples.api_for_sqlalchemy.urls import add_routes
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/examples/api_for_sqlalchemy/urls.py", line 20, in <module>
from .api.user import (
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/examples/api_for_sqlalchemy/api/__init__.py", line 3, in <module>
from .user import UserFactory
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/examples/api_for_sqlalchemy/api/user.py", line 15, in <module>
from examples.api_for_sqlalchemy.helpers.factories.user import UserFactory, ErrorCreateUserObject
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/examples/api_for_sqlalchemy/helpers/factories/user.py", line 16, in <module>
from ...models.sqlalchemy import User
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/examples/api_for_sqlalchemy/models/sqlalchemy/__init__.py", line 3, in <module>
from examples.api_for_sqlalchemy.models.sqlalchemy.user import User
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/examples/api_for_sqlalchemy/models/sqlalchemy/user.py", line 11, in <module>
class User(Base, BaseModelMixin):
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/.venv/lib/python3.9/site-packages/sqlalchemy/orm/decl_api.py", line 199, in __init__
_as_declarative(reg, cls, dict_)
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/.venv/lib/python3.9/site-packages/sqlalchemy/orm/decl_base.py", line 247, in _as_declarative
return _MapperConfig.setup_mapping(registry, cls, dict_, None, {})
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/.venv/lib/python3.9/site-packages/sqlalchemy/orm/decl_base.py", line 328, in setup_mapping
return _ClassScanMapperConfig(
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/.venv/lib/python3.9/site-packages/sqlalchemy/orm/decl_base.py", line 559, in __init__
self._scan_attributes()
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/.venv/lib/python3.9/site-packages/sqlalchemy/orm/decl_base.py", line 958, in _scan_attributes
self._collect_annotation(
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/.venv/lib/python3.9/site-packages/sqlalchemy/orm/decl_base.py", line 1151, in _collect_annotation
extracted = _extract_mapped_subtype(
File "/home/just495/Projects/github.com/just495/FastAPI-REST-JSONAPI/.venv/lib/python3.9/site-packages/sqlalchemy/orm/util.py", line 2306, in _extract_mapped_subtype
raise sa_exc.ArgumentError(
sqlalchemy.exc.ArgumentError: Type annotation for "User.created_at" can't be correctly interpreted for Annotated Declarative Table form. ORM annotations should normally make use of the ``Mapped[]`` generic type, or other ORM-compatible generic type, as a container for the actual type, which indicates the intent that the attribute is mapped. Class variables that are not intended to be mapped by the ORM should use ClassVar[]. To allow Annotated Declarative to disregard legacy annotations which don't use Mapped[] to pass, set "__allow_unmapped__ = True" on the class or a superclass this class. (Background on this error at: https://sqlalche.me/e/20/zlpr)
if sqlachemy version more then 2.0.0 raised error:
Started from uvicorn 0.19.0 removed '--debug' flag: encode/uvicorn#1640
The text was updated successfully, but these errors were encountered: