'Dash | TypeError: render_default_labels() takes 9 positional arguments but 10 were given

Goal: Find function call and amend parameters passed.

Traceback:

Traceback (most recent call last):
  File "/home/me/miniconda3/envs/project/lib/python3.9/site-packages/dash/_callback.py", line 151, in add_context
    output_value = func(*func_args, **func_kwargs)  # %% callback invoked %%
TypeError: render_default_labels() takes 9 positional arguments but 10 were given

render_default_labels() does not appear in _callback.py. It's in app.py. Only 1 usage.

Function definition:

def render_default_labels(self, flag: str, request_url: str, apply_clicks: int, xaxis: str, counter: bool,
                              yaxis: str, yaxis2: str, groupby_function: str) -> (str, str, str):

Usage:

@property
    def callbacks(self) -> list:
        callbacks = super().callbacks
        callbacks.extend([
            ...
            (self.render_default_labels,
             [Output(self.customisation_tab.xaxis_label.id, 'value'),
              Output(self.customisation_tab.yaxis_label.id, 'value'),
              Output(self.customisation_tab.yaxis2_label.id, 'value')],
             [Input(self.initialised_cache_flag.id, 'children'),
              Input(self.location.id, 'href'),
              Input(self.apply_button.id, 'n_clicks')],
             [State(self.variables_tab.xaxis_dropdown.id, 'value'),
              State(self.variables_tab.counter_checklist.id, 'value'),
              State(self.variables_tab.yaxis_dropdown.id, 'value'),
              State(self.variables_tab.yaxis2_dropdown.id, 'value'),
              State(self.variables_tab.groupby_radio.id, 'value'),
              State(self.additional_variables_tab.log_transform_checklist.id, 'value')]),
            ...
        ])
        return callbacks


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source