ValueError: <class 'list'> has no matching SQLAlchemy type #1248
Unanswered
fabiobeoni
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Given these classes and 1-to-N relationships, I get compile time error:
ValueError: <class 'list'> has no matching SQLAlchemy type
referring to thecategory.py
fieldtodos: list["Todo"]
, while the relation hero/team does work.I cannot see any relevant difference between
todo/category
implementation andhero/team
implementation to justify the error:Operating System
Linux
Operating System Details
fastapi 0.115.6 FastAPI framework, high performance, easy to learn, fast to code, ready for production
├── pydantic >=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0
│ ├── annotated-types >=0.6.0
│ ├── pydantic-core 2.27.2
│ │ └── typing-extensions >=4.6.0,<4.7.0 || >4.7.0
│ └── typing-extensions >=4.12.2 (circular dependency aborted here)
├── starlette >=0.40.0,<0.42.0
│ └── anyio >=3.4.0,<5
│ ├── idna >=2.8
│ ├── sniffio >=1.1
│ └── typing-extensions >=4.5
└── typing-extensions >=4.8.0
python-dotenv 1.0.1 Read key-value pairs from a .env file and set them as environment variables
sqlmodel 0.0.22 SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.
├── pydantic >=1.10.13,<3.0.0
│ ├── annotated-types >=0.6.0
│ ├── pydantic-core 2.27.2
│ │ └── typing-extensions >=4.6.0,<4.7.0 || >4.7.0
│ └── typing-extensions >=4.12.2 (circular dependency aborted here)
└── sqlalchemy >=2.0.14,<2.1.0
├── greenlet !=0.4.17
└── typing-extensions >=4.6.0
SQLModel Version
0.0.22
Python Version
3.12
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions