Error when start python3 worker.py #200
Replies: 1 comment
-
Issue is being tracked in #201. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ubuntu@ip-172-31-59-66:~/bot/greed$ python3 worker.py
Traceback (most recent call last):
File "/home/ubuntu/bot/greed/worker.py", line 17, in
import database as db
File "/home/ubuntu/bot/greed/database.py", line 225, in
class Order(TableDeclarativeBase):
File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/decl_api.py", line 199, in init
as_declarative(reg, cls, dict)
File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/decl_base.py", line 247, in _as_declarative
return MapperConfig.setup_mapping(registry, cls, dict, None, {})
File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/decl_base.py", line 328, in setup_mapping
return _ClassScanMapperConfig(
File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/decl_base.py", line 559, in init
self._scan_attributes()
File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/decl_base.py", line 1001, in _scan_attributes
collected_annotation = self._collect_annotation(
File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/decl_base.py", line 1151, in _collect_annotation
extracted = _extract_mapped_subtype(
File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/util.py", line 2306, in _extract_mapped_subtype
raise sa_exc.ArgumentError(
sqlalchemy.exc.ArgumentError: Type annotation for "Order.items" 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)Beta Was this translation helpful? Give feedback.
All reactions