Cufflinks errors with Dash -- KeyErrors produced with Cufflinks's call to auth.get_config_file()

I have a Dash app where two functions have callbacks that take input from a dropdown box and generate a bar graph from a DataFrame via Cufflinks.

These charts both work, but they’ll occasionally produce an error all relating to auth.get_config_file().

I’m using

import cufflinks as cf
from plotly.offline import iplot

in my layout I have:

    html.Div(
        [dcc.Graph(id='my-graph1')],
        style={'width': '49%', 'display': 'inline-block'}
    ),
    html.Div(
        [dcc.Graph(id='my-graph2')],
        style={'width': '49%', 'display': 'inline-block'}
    ),

and then for both of these, I have functions that resemble:

@app.callback(
    Output('my-graph1', 'figure'),
    [Input('intermediate-value', 'children')]
)
def my_graph1(jsonified_team_data):
    team = pd.read_json(jsonified_team_data, orient='split')
    figure = team.iplot(
        kind='bar',
        barmode='stack',
        asFigure=True
    )
    return figure

When switching between inputs from a dropdown, or sometimes when the page initially loads, I’ll encounter KeyErrors relating to:
config_colorscale=auth.get_config_file()['colorscale'] or dimensions=auth.get_config_file()['dimensions'] or theme = auth.get_config_file()['theme'], but when I select the same input from the dropdown (and sometimes it takes a few times), the charts appear as expected.

Any idea what’s going on? I suspect it’s both functions using get_config_file() at the same time? Any idea how to avoid this?

I’m having the same issue, getting exceptions like this (‘titlefont’, ‘color’, ‘none’, (‘layout’,)

Not sure how to fix. It seems to sporadic, rather than something persistent with me. Any one know what the best way to fix this is?

It seems like new Cufflinks and Plotly 3.x seems to fix this issue

1 Like

I’m seeing this same error with the latest version of Dash and cufflinks and implemented a workaround.

I’ve raised this issue with cufflinks: https://github.com/santosjorge/cufflinks/issues/180