Skip to content

Commit b01082e

Browse files
author
Dominik Neise
committed
calendar_data has no index, this seems to lead to problems in to_sql
1 parent 9590718 commit b01082e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

shifthelper/db_cloner/__main__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ def main():
8484
table = pd.read_sql_query(query_func(), conn)
8585
# we save the table to a temporary placeholder to make the
8686
# change atomic
87-
table.to_sql('t1', db_out, if_exists="replace")
87+
if table_name == 'calendar_data':
88+
table.to_sql('t1', db_out, if_exists="replace", index=False)
89+
else:
90+
table.to_sql('t1', db_out, if_exists="replace")
8891
db_out.execute('DROP TABLE IF EXISTS t2')
8992
if db_out.dialect.has_table(db_out, table_name):
9093
db_out.execute('RENAME TABLE {t} to t2, t1 to {t}'.format(

0 commit comments

Comments
 (0)