MCPcopy
hub / github.com/PrefectHQ/prefect / replace_blocks_with_values

Method replace_blocks_with_values

src/prefect/runner/storage.py:702–710  ·  view source on GitHub ↗
(obj: Any)

Source from the content-addressed store, hash-verified

700 scheme, _, _, _, _ = urlsplit(self._url)
701
702 def replace_blocks_with_values(obj: Any) -> Any:
703 if isinstance(obj, Block):
704 if get := getattr(obj, "get", None):
705 return get()
706 if hasattr(obj, "value"):
707 return getattr(obj, "value")
708 else:
709 return obj.model_dump()
710 return obj
711
712 settings_with_block_values = visit_collection(
713 self._settings, replace_blocks_with_values, return_data=True

Callers

nothing calls this directly

Calls 2

getFunction · 0.50
model_dumpMethod · 0.45

Tested by

no test coverage detected