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

bug with alembic=1.11 #419

Closed xg1990 closed 1 year ago

xg1990 commented 1 year ago
  File "/usr/local/lib/python3.11/site-packages/scrapy/core/spidermw.py", line 106, in process_sync
    for r in iterable:
  File "/usr/local/lib/python3.11/site-packages/scrapy/spidermiddlewares/depth.py", line 31, in <genexpr>
    return (r for r in result or () if self._filter(r, response, spider))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/scrapy/core/spidermw.py", line 106, in process_sync
    for r in iterable:
  File "/app/homesearch/spiders/domain.py", line 121, in parse
    db["properties"].upsert(_property_data, ["domain_id"])
  File "/usr/local/lib/python3.11/site-packages/dataset/table.py", line 261, in upsert
    row = self._sync_columns(row, ensure, types=types)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataset/table.py", line 381, in _sync_columns
    self._sync_table(sync_columns.values())
  File "/usr/local/lib/python3.11/site-packages/dataset/table.py", line 356, in _sync_table
    self.db.op.add_column(self.name, column, self.db.schema)
TypeError: add_column() takes 3 positional arguments but 4 were given

The latest alembic=1.12 has a different add_column()

Downgrading to alembic=1.10 can solve the problem

hans-fiby commented 1 year ago

I just changed line 356 in table.py to:

   self.db.op.add_column(self.name, column, schema=self.db.schema)

now it works with alembic=1.12