I am having this annoying error that I could not solve.. here is my function
def savePicture(pic):
try:
connection=sqlite3.connect(\'/home/faris/Desktop/
Ok, That is stupid lol
pic.caption,
pic.created_time,
are not TEXT type..but the error msg is saying the problem from pic.user.profile_picture. thus, if you have this error just check all the parameters :)
Read the comment below :)
The easiest way to solve that issue is- convert all the dataframe columns into str, and apply to_sql method.
df = df.applymap(str)
otherwise, you can change the data types of each column that are compatible with SQLite datatypes before saving the dataframe into SQLite table. dtype
parameter of to_sql
method would be useful to convert the datatypes of the columns while inserting the data into SQL table.