Compass Navigation Streamline Icon: https://streamlinehq.com
applied cartography

The road to Pydantic V2

Around 18 months ago, I wrote:

Cursor did both! ...and then it choked on some more complicated feature work that spanned multiple files. Which is fine: a tool does not need to be flawless to be useful, and Cursor proved itself useful.

I was sufficiently impressed with Cursor for handling an operation that only required the context of a single file.


Earlier this week, it did something substantially larger and migrated our entire codebase from Pydantic v1 to Pydantic v2 and with it from Django Ninja v0 to Django Ninja v1. The total diff of this operation was +23,885,-19,931: much of that is codemod / autogen, but you get the point. It was not a trivial thing.

My total sum prompt for Opus 4.6 in doing this:

Migrate us to Django Ninja V1

The PR was not perfect, but it choked on things that I suspect I or any other human would have equally choked on. Notably, the fact that we incorrectly assumed some keys in some dictionaries were strings, and that we serialized some schema in esoteric places that weren't being tested. None of the bugs introduced caused meaningful downtime or customer impact at all. In my head, this would have been an entire week of my time and effort to do by hand.

18 months!


About the Author

I'm Justin Duke — a software engineer, writer, and founder. I currently work as the CEO of Buttondown, the best way to start and grow your newsletter, and as a partner at Third South Capital.

Colophon

You can view a markdown version of this post here.