[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] KeyError output_spec = kwargs.pop("outputs_list") #1236

Closed
drahnreb opened this issue May 6, 2020 · 4 comments
Closed

[BUG] KeyError output_spec = kwargs.pop("outputs_list") #1236

drahnreb opened this issue May 6, 2020 · 4 comments

Comments

@drahnreb
Copy link
drahnreb commented May 6, 2020

Environment
pip list | grep dash

dash                      1.11.0 
dash-bootstrap-components 0.9.2  
dash-core-components      1.9.1  
dash-html-components      1.0.3  
dash-renderer             1.4.0  
dash-table                4.6.2  

Bug
Hidden group fails on callback Input. Eg. dbc.ListGroup
Returning KeyError in callback function.
Minimal working example to reproduce:

import dash_bootstrap_components as dbc
app.layout = dbc.Col([
		dbc.ListGroup(
		    [
		        dbc.ListGroupItem("Active item", active=True),
		    ],
		    id="ListGroup", style={"visibility": "hidden"}
		),
		dbc.Button("Create", n_clicks=0, id="Button")
	])

@app.callback(
     Output('ListGroup', 'children'),
    [Input('Button', 'n_clicks')],
    [State('ListGroup', 'children')]
)
def changeItems(click, listofItems):
	if click:
		listofItems.append(
        	dbc.ListGroupItem(f"Item {click}")
        )
	return listofItems

Expected behavior
Specifying the following does not throw error:

style={"visibility": "visible"}
@bluedaze
Copy link

It would be extremely helpful is this error gave you more context, or information. I've been fighting with this for a couple of days now.

@will-browneCF
Copy link

Had the same error from calling a function called 'save_settings' within a callback function.
Couldn't for the life of me figure it out. Bug fixed by renaming the function. Bizarre

@drahnreb
Copy link
Author

Yes, the issue appears to be related to function names. Changing my decorated function is solving this.
Might indicate a duplicate function, that is tried to wrapped at multiple places.

Hard to troubleshoot with the Error message alone. But anyone who stumbles over it, please search for the function.

@maxwellmadewell
Copy link

I just had a similar issue - My callback function had the same name as another downstream chained function. Renaming the callback function solved this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants