Since SQLAlchemy 1.3.16 `orm.selectinload` will no longer `ORDER BY` the primary key of the parent entity. sqlalchemy/sqlalchemy@d3cc4cd This is causing three of the batching tests to fail. Fixed in #261 Commit: chrisberks@730b777