Skip to content

Commit

Permalink
BUG: enable multivalues insert
Browse files Browse the repository at this point in the history
  • Loading branch information
danfrankj committed Feb 12, 2018
1 parent 569bc7a commit 89fad1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,10 @@ def insert_data(self):

def _execute_insert(self, conn, keys, data_iter):
data = [{k: v for k, v in zip(keys, row)} for row in data_iter]
conn.execute(self.insert_statement(), data)
if conn.dialect.supports_multivalues_insert:
conn.execute(self.insert_statement().values(data))
else:
conn.execute(self.insert_statement(), data)

def insert(self, chunksize=None):
keys, data_list = self.insert_data()
Expand Down

0 comments on commit 89fad1c

Please sign in to comment.