I'm doing a Flask course but when I run this code, it throws an error:
for origin, destination, duration in reader:
db.execute("INSERT INTO flights (origin, destination, duration) VALUES (:origin, :destination, :duration)",
{"origin": origin, "destination": destination, "duration": duration})
print(f"Added flight from {origin} to {destination} lasting {duration} minutes.")
db.commit()
The error in the last line (db.commit(), and db.execute()):
db: scoped_session
Instance of 'scoped_session' has no 'commit' memberpylint(no-member)
What can I do to fix it? I already installed the package sqlalchemy that other questions suggests.