https://prefect.io logo
z

Zach

11/20/2020, 7:36 PM
The task decorator on the function looked like this:
Copy code
@task(
    checkpoint=True,
    result=GCSResult(
        bucket="my-bucket",
        location=RESULT_LOCATION_FORMAT,
        serializer=PickleSerializer(),
    )
)
j

Jim Crist-Harif

11/20/2020, 7:41 PM
Hi Zach, Provided you have the same libraries present in the environment you're unpickling in (same python version, prefect, etc...), you should be able to download the file from GCS and load it with `pickle.load`:
Copy code
with open("your-file", "rb") as f:
    data = pickle.load(f)
In general - all prefect serializers have a deserializer method to load a result from bytes.
Copy code
serializer = TheSerializerYouUsed()

with open("your-file", "rb") as f:
    serialized_bytes = f.read()
data = serializer.deserialize(serialized_bytes)