import pandas as pd
def Login(id):
connection = dbconnect()
sql_query = 'select * from user where id=%(id)s;'
params = {'id': id}
user = pd.read_sql(sql_query, connection,params=params)
print (user)
connection.commit()
connection.close()
if __name__ == '__main__':
id=100
Login(connection)
я получаю следующую ошибку при выполнении этого кода:
DatabaseError: Execution failed on sql 'select * from user where id=%(id)s;': can't adapt type 'psycopg2.extensions.connection'
я не понял ошибку.