The question might sound silly but I am interested to know the following:
my_df = pd.read_sql_query(sql_script.read(), engine).astype(object)
functions with the pandas version 1.0.5 and does not allow for the NaNs in the integer column to be turned to floats whereas on pandas version 1.3.5 .astype(object) does absolutely nothing.
I am curious to know why is this and of course what is the best approach for keeping the data obtained from sql as is without converting it to floats (where columns have NaNs because NaNs are floats).
Thank you in advance!