# Buggy code
def insert_statement(self):
    names = list(map(str, self.frame.columns))
    wld = "?"  # wildcard char
    escape = _get_valid_sqlite_name

    if self.index is not None:
        for idx in self.index[::-1]:
            names.insert(0, idx)

    bracketed_names = [escape(column) for column in names]
    col_names = ",".join(bracketed_names)
    wildcards = ",".join([wld] * len(names))
    insert_statement = (
        f"INSERT INTO {escape(self.name)} ({col_names}) VALUES ({wildcards})"
    )
    return insert_statement


# Traceback (TypeError)
INFO  - ==========================================================================
INFO  - Inserting data one per row.
INFO  - Data inserted successfully!
INFO  - ==========================================================================
INFO  - Inserting data with multirow method.
ERROR - Error while inserting data with multirow method:
Traceback (most recent call last):
File "bug_multirow_sqlite.py", line 52, in store_df_data
df.to_sql("financial_data", con=conn, if_exists="append", index=False, method="multi")
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\core\generic.py", line 2531, in to_sql
dtype=dtype, method=method)
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 460, in to_sql
chunksize=chunksize, dtype=dtype, method=method)
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 1547, in to_sql
table.insert(chunksize, method)
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 686, in insert
exec_insert(conn, keys, chunk_iter)
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 609, in _execute_insert_multi
conn.execute(self.table.insert(data))
TypeError: insert() takes exactly 2 arguments (1 given)
INFO  - ==========================================================================
INFO  - Inserting data with multirow method and chunksize.
ERROR - Error while inserting data with multirow method and chunksize:
Traceback (most recent call last):
File "bug_multirow_sqlite.py", line 64, in store_df_data
df.to_sql("financial_data", con=conn, if_exists="append", index=False, method="multi", chunksize=10)
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\core\generic.py", line 2531, in to_sql
dtype=dtype, method=method)
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 460, in to_sql
chunksize=chunksize, dtype=dtype, method=method)
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 1547, in to_sql
table.insert(chunksize, method)
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 686, in insert
exec_insert(conn, keys, chunk_iter)
File "C:\Users\jconstanzo\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\io\sql.py", line 609, in _execute_insert_multi
conn.execute(self.table.insert(data))
TypeError: insert() takes exactly 2 arguments (1 given)

# Fixed code
def insert_statement(self, *, num_rows):
    names = list(map(str, self.frame.columns))
    wld = "?"  # wildcard char
    escape = _get_valid_sqlite_name

    if self.index is not None:
        for idx in self.index[::-1]:
            names.insert(0, idx)

    bracketed_names = [escape(column) for column in names]
    col_names = ",".join(bracketed_names)

    row_wildcards = ",".join([wld] * len(names))
    wildcards = ",".join(f"({row_wildcards})" for _ in range(num_rows))
    insert_statement = (
        f"INSERT INTO {escape(self.name)} ({col_names}) VALUES {wildcards}"
    )
    return insert_statement