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

Method model_validate

src/prefect/blocks/core.py:2056–2079  ·  view source on GitHub ↗
(
        cls: type[Self],
        obj: dict[str, Any] | Any,
        *,
        strict: bool | None = None,
        from_attributes: bool | None = None,
        context: dict[str, Any] | None = None,
    )

Source from the content-addressed store, hash-verified

2054
2055 @classmethod
2056 def model_validate(
2057 cls: type[Self],
2058 obj: dict[str, Any] | Any,
2059 *,
2060 strict: bool | None = None,
2061 from_attributes: bool | None = None,
2062 context: dict[str, Any] | None = None,
2063 ) -> Self:
2064 if isinstance(obj, dict):
2065 obj = cast(dict[str, Any], obj)
2066 extra_serializer_fields = {
2067 "_block_document_id",
2068 "_block_document_name",
2069 "_is_anonymous",
2070 }.intersection(obj.keys())
2071 for field in extra_serializer_fields:
2072 obj.pop(field, None)
2073
2074 return super().model_validate(
2075 obj,
2076 strict=strict,
2077 from_attributes=from_attributes,
2078 context=context,
2079 )
2080
2081 def model_dump(
2082 self,

Callers 15

get_s3_clientFunction · 0.45
replicate_ecs_eventFunction · 0.45
_replicate_pod_eventFunction · 0.45
test_minimalMethod · 0.45
_consume_eventsMethod · 0.45
_tracedFunction · 0.45

Calls 2

keysMethod · 0.45
popMethod · 0.45