Skip to main content

FlytePickle

This type is only used by flytekit internally. User should not use this type. Any type that flyte can't recognize will become FlytePickle

Attributes

AttributeTypeDescription
origin[FlytePickle](flytepickle.md?sid=flyte_types__pickle_flytepickle) = FlytePickleReference to the base FlytePickle class used by the type engine to identify specialized pickle formats as generic variants.

Methods


python_type()

@classmethod
def python_type() - > typing.Type

Retrieves the underlying Python type associated with this FlytePickle instance.

Returns

TypeDescription
typing.TypeThe Python class type that this pickle wrapper represents.

to_pickle()

@classmethod
def to_pickle(
python_val: typing.Any
) - > str

Serializes a Python object using cloudpickle and uploads the resulting bytes to the configured storage provider.

Parameters

NameTypeDescription
python_valtyping.AnyThe Python object instance to be serialized and stored.

Returns

TypeDescription
strThe storage URI where the serialized pickle file has been persisted.

from_pickle()

@classmethod
def from_pickle(
uri: str
) - > typing.Any

Deserialize the pickle, and return data in the pickle, and download pickle file to local first if file is not in the local file systems.

Parameters

NameTypeDescription
uristrThe local path or remote URI pointing to the serialized pickle file.

Returns

TypeDescription
typing.AnyThe original Python object reconstructed from the stored pickle file.