The GitHub Actions job "Required Checks" on texera.git/xinyuan-loop-feb has 
failed.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
0b01d012618a8de9041971d20bd415a28b7ac6a2 / Xinyuan Lin <[email protected]>
fix+test(loop): LoopEnd.condition() is safe before any state is consumed

Addresses PR #4206 review feedback
(https://github.com/apache/texera/pull/4206#discussion_r3400851487):
eval_condition read self._loop_table / self.state, which only run_update
assigns. MainLoop.complete() calls condition() on every LoopEnd, so a
LoopEnd that finished without consuming a matching state -- an inner
LoopEnd that only forwarded outer-loop pass-through state, or a loop with
no matching-branch consume -- raised AttributeError. (The _StubLoopEnd
test stub masked it by pre-seeding self.state.)

* LoopEndOperator.__init__ now initializes self.state = {},
  self._loop_table = None, and self._consumed_state = False (the class
  previously had no __init__; the generated ProcessLoopEndOperator has no
  __init__/open either, so it inherits this).
* run_update sets self._consumed_state = True after the consume.
* eval_condition returns False when nothing has been consumed -- the loop
  never iterated here, so don't fire the back-edge. Bare field init alone
  wasn't enough: the user condition (e.g. ) would then
  NameError on undefined loop variables.

Tests: unmask _StubLoopEnd (drop its self.state = {} so it mirrors the
generated operator and exercises the base __init__); add
test_condition_returns_false_before_any_state_is_consumed (the reviewer
scenario) and test_consumed_flag_flips_after_run_update. 16 loop +
33 main_loop/output_manager tests pass; no behavior change on the normal
consume path.

Report URL: https://github.com/apache/texera/actions/runs/27454322752

With regards,
GitHub Actions via GitBox

Reply via email to