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

Function _expand_dep

dash/mcp/primitives/tools/callback_adapter.py:365–382  ·  view source on GitHub ↗

Attach a concrete value to a callback dependency to produce a valid callback input. For regular deps, returns ``{id, property, value}``. For ALL/ALLSMALLER: passes through the list of ``{id, property, value}`` dicts. For MATCH: passes through the single ``{id, property, value}`` di

(dep: CallbackDependency, value: Any)

Source from the content-addressed store, hash-verified

363
364
365def _expand_dep(dep: CallbackDependency, value: Any) -> CallbackInputs:
366 """
367 Attach a concrete value to a callback dependency to produce a valid callback input.
368
369 For regular deps, returns ``{id, property, value}``.
370 For ALL/ALLSMALLER: passes through the list of ``{id, property, value}`` dicts.
371 For MATCH: passes through the single ``{id, property, value}`` dict.
372 """
373 pattern = parse_wildcard_id(dep.get("id", ""))
374 if pattern is None:
375 return CallbackInput(id=dep["id"], property=dep["property"], value=value)
376
377 # LLM provides browser-like format
378 if isinstance(value, list):
379 return cast("list[CallbackInput]", value)
380 if isinstance(value, dict) and "id" in value:
381 return cast(CallbackInput, value)
382 return CallbackInput(id=dep["id"], property=dep["property"], value=value)
383
384
385def _expand_output_spec(

Callers 1

as_callback_bodyMethod · 0.85

Calls 3

parse_wildcard_idFunction · 0.90
CallbackInputClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…