Copilot commented on code in PR #3657:
URL: https://github.com/apache/texera/pull/3657#discussion_r2272102748
##########
core/amber/src/main/python/pytexera/udf/examples/test_generator_operator.py:
##########
@@ -29,6 +29,7 @@ def generator_operator(self):
def test_generator_operator(self, generator_operator):
generator_operator.open()
outputs = generator_operator.produce()
- output_tuple = Tuple(next(outputs))
- assert output_tuple == Tuple({"test": [1, 2, 3]})
+ for i in [1, 2, 3]:
+ output_tuple = Tuple(next(outputs))
Review Comment:
The `next(outputs)` call is inside the loop but will only get the first
output tuple on each iteration. This will cause a StopIteration exception after
the first iteration since there are only 3 outputs total. Move the
`output_tuple = Tuple(next(outputs))` line inside the loop but ensure it's
called once per iteration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]