"Variable, die in Typ -Expression nicht zulässig ist" Warnung beim Erstellen von SQLAchemy -Sitzungen mit DI

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: "Variable, die in Typ -Expression nicht zulässig ist" Warnung beim Erstellen von SQLAchemy -Sitzungen mit DI

by Anonymous » 22 Aug 2025, 05:26

Ich habe ein grundlegendes Sqlalchemy -Setup für ein Fastapi -Projekt. Ich habe eine Abhängigkeit für eine Datenbanksitzung gemacht, wie die meisten Tutorials vorschlagen: < /p>

Code: Select all

from sqlalchemy.orm import sessionmaker

SessionLocal = sessionmaker(engine, **sqlalchemy_session_options)

def get_session() -> SessionLocal:
with SessionLocal() as database:
yield database
Aber Pylance gibt mir "Variable nicht in Typexpression" WARNUNG:

Top