Hello everyone,
I have been loving dash and using it for a while now. Recently, I had to re-install the packages and thus dash updated. After that, I have been experiencing an error for the data table. I am basically updating the data table depending on the selection of a dropdown menu. Here is the part that gets triggered when the drowdown selection changes:
@app.callback([Output('datatable', 'data'),
Output('datatable', 'columns')],
[Input('user_selection', 'value')])
def update_output(value):
user_found = False
for user in all_users:
if user.id == value:
selectedUserIndex = all_users.index(user)
user_found = True
break
if user_found:
selected_user = all_users[selectedUserIndex]
all_sessions_df = pd.DataFrame.from_records([s.to_dict() for s in selected_user.allSessions])
return all_sessions_df.to_dict('records'), [{"name": j, "id": j} for j in all_sessions_df.columns]
else:
return [], []
Before the upgrade, everything was working fine. Now, I am getting the following error:
Invalid argument columns[0]
passed into DataTable with ID “datatable”.
Expected object
.
Was supplied type string
.
when I load the page.
Any help will be highly appreciated.
Thanks,
Daniyal