Sep 2026 12 min read
Don't call .all() on a training export
Why a generator that opens with .all() isn't lazy at all, and the three changes — streaming with yield_per, offloading CSV formatting to Postgres COPY, and batching the rows Python still has to touch — that let a recommender's training export survive tenants with millions of users instead of getting OOM-killed.