Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample services not starting #7

Closed
just495 opened this issue Feb 2, 2023 · 1 comment
Closed

Sample services not starting #7

just495 opened this issue Feb 2, 2023 · 1 comment

Comments

@just495
Copy link
Contributor

just495 commented Feb 2, 2023

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)

Started from uvicorn 0.19.0 removed '--debug' flag: encode/uvicorn#1640

@just495
Copy link
Contributor Author

just495 commented Feb 2, 2023

#6 pull request

@Znbiz Znbiz closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants