# Serialization
# JSONCompatible
Field that ensures its values are JSON-compatible during serialization and deserialization
Args:
*args (Any)
: the arguments accepted bymarshmallow.Field
**kwargs (Any)
: the keyword arguments accepted bymarshmallow.Field
# Nested
An extension of the Marshmallow Nested field that allows the value to be selected via a value_selection_fn.
Note that because the value_selection_fn is always called, users must return marshmallow.missing
if they don't want this field included in the resulting serialized object.
Args:
nested (type)
: the nested schema classvalue_selection_fn (Callable)
: a function that is called whenever the object is serialized, to retrieve the object (if not available as a simple attribute of the parent schema)**kwargs (Any)
: the keyword arguments accepted bymarshmallow.Field
# Bytes
A Marshmallow Field that serializes bytes to a base64-encoded string, and deserializes a base64-encoded string to bytes.
Args:
*args (Any)
: the arguments accepted bymarshmallow.Field
**kwargs (Any)
: the keyword arguments accepted bymarshmallow.Field
# UUID
Replacement for fields.UUID that performs validation but returns string objects, not UUIDs
Args:
*args (Any)
: the arguments accepted bymarshmallow.Field
**kwargs (Any)
: the keyword arguments accepted bymarshmallow.Field
# FunctionReference
class
prefect.utilities.serialization.FunctionReference
(valid_functions, reject_invalid=True, **kwargs)[source]Field that stores a reference to a function as a string and reloads it when deserialized.
Args:
valid_functions (List[Callable])
: a list of functions that will be serialized as string referencesreject_invalid (bool)
: if True, functions not invalid_functions
will be rejected. If False, any value will be allowed, but only functions invalid_functions
will be deserialized.**kwargs (Any)
: the keyword arguments accepted bymarshmallow.Field
# Functions
top-level functions: |
---|
prefect.utilities.serialization.to_qualified_name (obj)[source] |
Given an object, returns its fully-qualified name, meaning a string that represents its Python import path
|
prefect.utilities.serialization.from_qualified_name (obj_str)[source] |
Retrives an object from a fully qualified string path. The object must be imported in advance.
|
This documentation was auto-generated from commit bd9182e
on July 31, 2024 at 18:02 UTC