@@ -64,7 +64,7 @@ def _invoke_callback(func, *args, **kwargs): # used to mark the frame for the d
6464GLOBAL_INLINE_SCRIPTS = []
6565
6666
67- # pylint: disable=too-many-locals
67+ # pylint: disable=too-many-locals,too-many-arguments
6868def callback (
6969 * _args ,
7070 background : bool = False ,
@@ -78,6 +78,7 @@ def callback(
7878 cache_ignore_triggered = True ,
7979 on_error : Optional [Callable [[Exception ], Any ]] = None ,
8080 optional : Optional [bool ] = False ,
81+ hidden : Optional [bool ] = False ,
8182 ** _kwargs ,
8283) -> Callable [..., Any ]:
8384 """
@@ -162,6 +163,8 @@ def callback(
162163 to access the original callback inputs, states and output.
163164 :param optional:
164165 Mark all dependencies as not required on the initial layout checks.
166+ :param hidden:
167+ Hide the callback from the devtools callbacks tab.
165168 """
166169
167170 background_spec = None
@@ -217,6 +220,7 @@ def callback(
217220 running = running ,
218221 on_error = on_error ,
219222 optional = optional ,
223+ hidden = hidden ,
220224 )
221225
222226
@@ -263,6 +267,7 @@ def insert_callback(
263267 dynamic_creator : Optional [bool ] = False ,
264268 no_output = False ,
265269 optional = False ,
270+ hidden = False ,
266271):
267272 if prevent_initial_call is None :
268273 prevent_initial_call = config_prevent_initial_callbacks
@@ -287,6 +292,7 @@ def insert_callback(
287292 "dynamic_creator" : dynamic_creator ,
288293 "no_output" : no_output ,
289294 "optional" : optional ,
295+ "hidden" : hidden ,
290296 }
291297 if running :
292298 callback_spec ["running" ] = running
@@ -631,6 +637,7 @@ def register_callback(
631637 running = running ,
632638 no_output = not has_output ,
633639 optional = _kwargs .get ("optional" , False ),
640+ hidden = _kwargs .get ("hidden" , False ),
634641 )
635642
636643 # pylint: disable=too-many-locals
0 commit comments