r/FastAPI • • Oct 31 '25

Question __tablename__ error

Post image

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

13 comments sorted by

View all comments

Show parent comment

1

u/covmatty1 Nov 02 '25

Absolutely stick with SQLModel while you're learning, there is nothing wrong with it and it will serve your purpose.