Skip to content

Commit ba17593

Browse files
committed
Use _allow_dynamic_callbacks flag to bypass import in callbacks warning.
1 parent 4d5aa7d commit ba17593

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dash/_callback.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ def insert_callback(
261261
"output": output,
262262
"raw_inputs": inputs,
263263
"manager": manager,
264+
"allow_dynamic_callbacks": dynamic_creator,
264265
}
265266
callback_list.append(callback_spec)
266267

dash/dash.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,6 @@ def long_callback(
12851285
def dispatch(self):
12861286
body = flask.request.get_json()
12871287

1288-
app_studio = "app_studio" in ComponentRegistry.registry
12891288
nlibs = len(ComponentRegistry.registry)
12901289

12911290
g = AttributeDict({})
@@ -1317,6 +1316,7 @@ def dispatch(self):
13171316

13181317
try:
13191318
cb = self.callback_map[output]
1319+
_allow_dynamic = cb.get("allow_dynamic_callbacks", False)
13201320
func = cb["callback"]
13211321
g.background_callback_manager = (
13221322
cb.get("manager") or self._background_manager
@@ -1383,7 +1383,7 @@ def dispatch(self):
13831383
)
13841384
)
13851385

1386-
if not app_studio and nlibs != len(ComponentRegistry.registry):
1386+
if not _allow_dynamic and nlibs != len(ComponentRegistry.registry):
13871387
print(
13881388
"Warning: component library imported during callback, move to top-level for full support.",
13891389
file=sys.stderr,

0 commit comments

Comments
 (0)