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
| Attribute | Type | Description |
|---|---|---|
| origin | [FlytePickle](flytepickle.md?sid=flyte_types__pickle_flytepickle) = FlytePickle | Reference 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
| Type | Description |
|---|---|
typing.Type | The 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
| Name | Type | Description |
|---|---|---|
| python_val | typing.Any | The Python object instance to be serialized and stored. |
Returns
| Type | Description |
|---|---|
str | The 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
| Name | Type | Description |
|---|---|---|
| uri | str | The local path or remote URI pointing to the serialized pickle file. |
Returns
| Type | Description |
|---|---|
typing.Any | The original Python object reconstructed from the stored pickle file. |