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
Kevin Kho
11/16/2021, 2:49 AM
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
John T
11/16/2021, 2:51 AM
Awesome, thank you so much!
Just one small question, what do you mean in the last sentence?
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.