MCPcopy Index your code
hub / github.com/plotly/dash / validate_callback

Function validate_callback

dash/_validate.py:22–51  ·  view source on GitHub ↗
(outputs, inputs, state, extra_args, types)

Source from the content-addressed store, hash-verified

20
21
22def validate_callback(outputs, inputs, state, extra_args, types):
23 Input, Output, State = types
24 if extra_args:
25 if not isinstance(extra_args[0], (Output, Input, State)):
26 raise exceptions.IncorrectTypeException(
27 dedent(
28 f"""
29 Callback arguments must be `Output`, `Input`, or `State` objects,
30 optionally wrapped in a list or tuple. We found (possibly after
31 unwrapping a list or tuple):
32 {repr(extra_args[0])}
33 """
34 )
35 )
36
37 raise exceptions.IncorrectTypeException(
38 dedent(
39 f"""
40 In a callback definition, you must provide all Outputs first,
41 then all Inputs, then all States. After this item:
42 {(outputs + inputs + state)[-1]!r}
43 we found this item next:
44 {extra_args[0]!r}
45 """
46 )
47 )
48
49 for args in [outputs, inputs, state]:
50 for arg in args:
51 validate_callback_arg(arg)
52
53
54def validate_callback_arg(arg):

Callers 2

handle_callback_argsFunction · 0.85

Calls 1

validate_callback_argFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…