Hello!
When I add a new row into dash datatable and save it into to database, then all my columns dtype changes to object or string. How can I solve such a problem, because I have a large dataset with a lot of columns and don’t want the dtypes of columns to be changed!
# callback fo adding new row
@app.callback(
Output('our-table', 'data'),
[Input('editing-rows-button', 'n_clicks')],
[State('our-table', 'data'),
State('our-table', 'columns')],
prevent_initial_call=True)
def add_row(n_clicks, rows, columns):
if n_clicks > 0:
rows.append({c['id']: '' for c in columns})
return rows