This is an issue using python 3.7+, where raising StopIteration now explicitly raises a RuntimeError [1], and causes the streaming timeseries jobs to fail. The solution is to swap raise StopIteration with return [2].
RuntimeError
raise StopIteration
return