Software Engineering for Data Scientists, Part 1: Pydantic Is All You Need for Poor Performance Spaghetti Code (opens in new tab)
Save planet earth, stop using Pydantic everywhere - I love Pydantic. And I’ve witnessed some of the worst code written with Pydantic. Pure spaghetti, non-performant code. There are two major anti-patterns in abusing Pydantic for maximum spaghetti. First anti-pattern is serdes debt. Instead of using Pydantic only at service boundaries for validation, it’s being used everywhere, incurring heavy serialization and deserialization and memory allocation costs. Second anti-pattern is inheritance ove...
Read the original article