Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

got multiple values for argument 'schema'

    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'

like image 359
sinan yılmaz Avatar asked Mar 29 '26 19:03

sinan yılmaz


2 Answers

The issue started just when my package got updated. It is working on these fixed versions.

pandas==1.1.5 SQLAlchemy==1.4.45

like image 107
Yogesh Kushwaha Avatar answered Apr 01 '26 13:04

Yogesh Kushwaha


I just had this issue on Pandas 1.1.3 + SQLAlchemy 2.0.0. Updated to 1.5.3 and it was gone.

like image 21
recacon Avatar answered Apr 01 '26 13:04

recacon