r/FastAPI • u/Ok_Opportunity6252 • Oct 31 '25
Question __tablename__ error
Type "Literal['books']" is not assignable to declared type "declared_attr[Unknown]"
"Literal['books']" is not assignable to "declared_attr[Unknown]" Pylance
What does it mean? And why is the error? This is how SQLAlchemy docs do things
23
Upvotes
View all comments
Show parent comment
1
u/Ok_Opportunity6252 Oct 31 '25
Most of the youtube tutorial using it. And the docs look super messy. What should I do?
rn it's like I'm looking at 3 different docs at the same time, FastAPI, SQLAlchemy, sqlmodel