zip(strict=True) catches lists that drifted apart
zip stops at the shortest input and says nothing. Pair ids with a list of results that came back one short and the last row is silently gone, or every row after the gap lands on the wrong id.
for user_id, result in zip(user_ids, results, strict=True):
save(user_id, result)With strict=True a length mismatch raises ValueError at the point where it went wrong, since Python 3.10. Default to it whenever the inputs are meant to line up.
python