I am able to successfully write the CSV data to SQLite using pandas in python using this code:
df = pandas.read_csv(path + '/issues.csv')
df.to_sql('issues', connection, if_exists='replace', index=False)
However, I want to define one of the columns as an integer, and according to the documents when I try to use this code:
df = pandas.read_csv(path + '/issues.csv')
df.to_sql('issues', connection, if_exists='replace', index=False, dtype={"severity_int": sqlalchemy.types.Integer()})
I get an error:
File "/usr/local/lib/python3.7/site-packages/pandas/io/sql.py", line 1722, in to_sql
raise ValueError(f"{col} ({my_type}) not a string")
ValueError: severity_int (INTEGER) not a string
I think I am doing it right but don't know where the error is.