It looks like df is not defined yet, but the callback plotly_maker
is still being fired at startup.
What you can do is put a try except block that checks for a NameError
and in the except block you can raise an exception. In this case, the preference would be raise dash.exceptions.PreventUpdate()
Reference: Handle first callback on App start
Hope that fixes this!