Hello Prefect friends, I’ve come here to be a bot...
# ask-community
j
Hello Prefect friends, I’ve come here to be a bother again. So, we are leveraging Pydantic objects as return values, but after running our first flow, we quickly realized that the
PrefectResult
requires the result to be JSON serializable. After digging into where
PrefectResult
was being used, we realized that we could change the serializer from
JSONSerializer()
to
PickleSerializer()
and have our pydantic objects move around seamlessly. We are however curious if changing the PrefectResult serializer to a pickling one can introduce some unforeseen consequences. Thanks in advance for any clarification!
k
I’d like to believe this would work because the
Serializer()
has a
deserialize
method which knows how to unpickle that so by the time it’s loaded in, it’s in the format you need. For example knows to bring it back out into a DataFrame upon loading
❤️ 1
💯 1
j
Awesome, thank you so much! Just one small question, what do you mean in the last sentence?
k
Oh sorry I mistyped. The
PandasSerializer
knows to bring it back out
j
Ahh, I see. Perfect, thanks so much