Skip to content

Commit b61b850

Browse files
authored
Update clickhouse_api.py
1 parent e6f61f2 commit b61b850

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mysql_ch_replicator/clickhouse_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ def insert(self, table_name, records, table_structure: TableStructure = None):
182182
if not records:
183183
return
184184

185+
if not isinstance(records, list):
186+
records = list(records)
187+
185188
process_indices = []
186189
if table_structure:
187190
for i, field in enumerate(table_structure.fields):
@@ -194,8 +197,9 @@ def insert(self, table_name, records, table_structure: TableStructure = None):
194197
process_indices.append(i)
195198

196199
for j, record in enumerate(records):
197-
record = list(record)
198-
records[j] = record
200+
if not isinstance(record, list):
201+
record = list(record)
202+
records[j] = record
199203

200204
for i in process_indices:
201205
e = record[i]

0 commit comments

Comments
 (0)