Altinity / clickhouse-mysql-data-reader

utility to read mysql data
MIT License
368 stars 94 forks source link

TypeError: unhashable type: 'list' #205

Open igor-kremin opened 3 months ago

igor-kremin commented 3 months ago

in tableprocessor.py for db in res: if not res[db]:

no tables in db, try to add all tables from DB

            tables = self.tables_list(db)
            res[db].add(tables)
            logging.debug("add {} tables to {} db".format(tables, db))

replace to line res[db].add(tables) => res[db].update(tables) as self.tables_list(db) returns list object

============= Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/clickhouse_mysql/main.py", line 134, in run migrator.migrate_all_tables(self.config.is_dst_create_table()) File "/usr/local/lib/python3.12/site-packages/clickhouse_mysql/tablemigrator.py", line 127, in migrate_all_tables dbs = self.dbs_tables_lists() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/clickhouse_mysql/tableprocessor.py", line 92, in dbs_tables_lists res[db].add(tables) TypeError: unhashable type: 'list'