pudo / dataset

Easy-to-use data handling for SQL data stores with support for implicit table creation, bulk loading, and transactions.
https://dataset.readthedocs.org/
MIT License
4.76k stars 297 forks source link

TypeError: MetaData.__init__() got an unexpected keyword argument 'bind' under sqlalchemy 2.0 #410

Closed karlicoss closed 1 year ago

karlicoss commented 1 year ago
  File "/tmp/home/.local/lib/python3.10/site-packages/dataset/table.py", line 628, in find                                                                                                                                                                                                
    query = self.table.select(whereclause=args, limit=_limit, offset=_offset)                                                                                                                                                                                                             
  File "/tmp/home/.local/lib/python3.10/site-packages/dataset/table.py", line 63, in table                                                                                                                                                                                                
    self._sync_table(())                                                                                                                                                                                                                                                                  
  File "/tmp/home/.local/lib/python3.10/site-packages/dataset/table.py", line 324, in _sync_table                                                                                                                                                                                         
    self._reflect_table()                                                                                                                                                                                                                                                                 
  File "/tmp/home/.local/lib/python3.10/site-packages/dataset/table.py", line 306, in _reflect_table                                                                                                                                                                                      
    self.name, self.db.metadata, schema=self.db.schema, autoload=True                                                                                                                                                                                                                     
  File "/tmp/home/.local/lib/python3.10/site-packages/dataset/database.py", line 109, in metadata                                                                                                                                                                                         
    return MetaData(schema=self.schema, bind=self.executable)                                                                                                                                                                                                                             
TypeError: MetaData.__init__() got an unexpected keyword argument 'bind'

There is a deprecation warning in 1.4 version https://docs.sqlalchemy.org/en/14/core/metadata.html#sqlalchemy.schema.MetaData.bind And it's gone in 2.0 https://docs.sqlalchemy.org/en/20/core/metadata.html#sqlalchemy.schema.MetaData

pudo commented 1 year ago

see #411.