tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.38k stars 356 forks source link

More efficient `utils.chunk` #1613

Closed Abdeldjalil-H closed 1 month ago

Abdeldjalil-H commented 1 month ago

The utils.chunk function from tortoise.utils is converting instances into list. I think it is better to not load all the list at one time but rather in chunks as the name suggested. This is useful in cases when the user passes a generator instead of list especially for large datasets.

Checklist:

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 9058250244

Details


Totals Coverage Status
Change from base Build 9028420328: 0.01%
Covered Lines: 5776
Relevant Lines: 6472

💛 - Coveralls
Abdeldjalil-H commented 1 month ago

It seems that the failing tests have nothing to do with the changes made, because the changed part is not being called at all for the failed test case. Moreover, it passes the first time, then when I changed contrubitors file it fails!