feat: default value for if_exist in to_sql changed to fail, test for

this behavior added.
This commit is contained in:
Fabian Joswig 2022-07-04 17:19:36 +01:00
parent 03d70d3757
commit a6ebcb59bb
2 changed files with 14 additions and 3 deletions

View file

@ -7,7 +7,7 @@ from ..correlators import Corr
from .json import create_json_string, import_json_string
def to_sql(df, table_name, db, if_exists="replace", gz=True):
def to_sql(df, table_name, db, if_exists='fail', gz=True):
"""Write DataFrame including Obs or Corr valued columns to sqlite database.
Parameters
@ -30,7 +30,7 @@ def to_sql(df, table_name, db, if_exists="replace", gz=True):
def read_sql_query(sql, db, auto_gamma=False):
"""Execute SQL query on sqlite database and obatin DataFrame including Obs or Corr valued columns.
"""Execute SQL query on sqlite database and obtain DataFrame including Obs or Corr valued columns.
Parameters
----------
@ -113,7 +113,7 @@ def _serialize_df(df, gz=False):
df : pandas.DataFrame
DataFrame to be serilized.
gz: bool
gzip the json string represenation. Default False.
gzip the json string representation. Default False.
"""
out = df.copy()
for column in out: