self.engine=create_engine("postgresql://postgres:12345@localhost/postgres")
self.con = self.engine.connect()
self.conn.autocommit = True
self.cursor = self.conn.cursor()
df.to_sql(symbol, schema='xxx', con=self.con, if_exists='append',
index=False)
df.to_sql(symbol, con=self.con, if_exists='append',
index=False)
I am getting this error in both cases while adding the dataframe to the postgre sql database
meta = MetaData(self.connectable, schema=schema)
TypeError: init() got multiple values for argument ‘schema’
2
Answers
I just had this issue on Pandas 1.1.3 + SQLAlchemy 2.0.0. Updated to 1.5.3 and it was gone.
The issue started just when my package got updated. It is working on these fixed versions.
pandas==1.1.5
SQLAlchemy==1.4.45