We've been discussing this in IRC. It turns out that IDistroSeries.getTranslationTemplates wasn't batching properly because it used shortlist() to limit its results. As a side effect, that listifies the query result—causing all its results to be fetched and marshaled. The batching logic then slices the resulting list instead of the query result, which is somewhat pointless.
The docstring deliberately makes no promise that getTranslationTemplates returns a list, so it's perfectly valid to return the query result directly instead of a shortlisted version of it. Unfortunately the distroseries translations copying script does assert that len(child.getTranslationTemplates()) == 0. This assumes a list-like return value; with a query it should assert that child.getTranslationTemplates.is_empty().
We've been discussing this in IRC. It turns out that IDistroSeries. getTranslationT emplates wasn't batching properly because it used shortlist() to limit its results. As a side effect, that listifies the query result—causing all its results to be fetched and marshaled. The batching logic then slices the resulting list instead of the query result, which is somewhat pointless.
The docstring deliberately makes no promise that getTranslationT emplates returns a list, so it's perfectly valid to return the query result directly instead of a shortlisted version of it. Unfortunately the distroseries translations copying script does assert that len(child. getTranslationT emplates( )) == 0. This assumes a list-like return value; with a query it should assert that child.getTransl ationTemplates. is_empty( ).