by dkarl · 4y ago · 0 comments
[0] How's this for an abomination: due to an error using SQLAlchemy, one of our types was being constructed in one way in our code and being constructed in a different way by SQLAlchemy. When we instantiated it directly, you got its properties using methods: organization_id(), last_updated_at(), etc. When we loaded it from the database using SQLAlchemy, organization_id, last_updated_at, etc. were fields, not methods. Somehow people managed to call foo.organization_id(), foo.last_updated_at(), etc. in all the code paths where we handled instances we instantiated directly, and access foo.organization_id, foo.last_updated_at, etc. in all the code paths where we dealt with instances fetched from the database.