Im using the function read_sql_query, i want to cast types when storing data in dataframe. I tried the rows below, but got this error
E TypeError: read_sql_query() got an unexpected keyword argument 'dtype'
dtypes = {
'dat1': 'object',
'dat2': 'object'
}
if function_1 =='f1':
if (self.table_name == 'table1'):
df_rows = pd.read_sql_query(sql=sql_query, con=conn, dtype=dtypes)