Upsert for sqlalchemy

I've been working on a codebase that included someone's implementation of an upsert function for sqlalchemy. It's a problem that you can approach a bunch of different ways, including at the sql layer, but a prior engineer had written a method in a mixin class that boils down to:

existing_val = getattr(existing, column.name, None)
new_val = getattr(self, column.name, None)

if new_val != existing_val:
    setattr(existing, column.name, new_val)

Week in Review

I've been working on my json-schema library, recently, and most of the non-reference based test cases are coming together. As part of that, I was using other libraries like quri and local-time for validating data in their respective domains. Since json-schema has a pre-made test suite I was surprised when some tests failed using them, but it turned into an opportunity to help out.

Plague Times

Just moved the blog from coleslaw to zora. Here are a couple scripts I used to convert things along the way!