Skip to content

Commit

Permalink
perf: Do not copy dataframe if uploading its index (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonni0 committed May 27, 2023
1 parent a62d2e3 commit a917f0a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bcpandas/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,8 @@ def to_sql(

_validate_args(df=df, sql_type=sql_type, if_exists=if_exists, batch_size=batch_size)

# TODO diff way to implement? could be big performance hit with big dataframe
if index:
df = df.copy(deep=True).reset_index()
df = df.reset_index()

delim = get_delimiter(df) if delimiter is None else delimiter
_quotechar = get_quotechar(df) if quotechar is None else quotechar
Expand Down

0 comments on commit a917f0a

Please sign in to comment.