aglinxinyuan commented on code in PR #5700:
URL: https://github.com/apache/texera/pull/5700#discussion_r3565597176
##########
amber/src/main/python/core/models/operator.py:
##########
@@ -291,3 +302,152 @@ def process_table(self, table: Table, port: int) ->
Iterator[Optional[TableLike]
time, or None.
"""
yield
+
+
+# ``table`` is seeded into the eval/exec namespaces the loop expressions run
+# in and stripped from every state dict that crosses Loop Start / Loop End,
+# so user code can neither persist nor clobber it. The envelope names
+# (``loop_counter`` / ``loop_start_id``) never enter user state -- they ride
+# the StateFrame envelope (see ``core.models.payload``). The loop-back write
+# address is setup config, not state (see ``loopStartStateUris`` on the
+# ``InitializeExecutorRequest`` proto).
+_RESERVED_STATE_KEYS: frozenset = frozenset({"table"})
Review Comment:
Both addressed. (1) Added `_TABLE_KEY = "table"`, derived
`_RESERVED_STATE_KEYS` from it, and referenced it at the inject/serialize/read
sites (the `_eval_loop_expr` seed, `produce_state_on_finish`, `run_update`) so
the literal is no longer repeated. (2) A `table` collision now raises via
`_reserved_name_error` instead of silently dropping: `produce_state_on_finish`
flags a `table` in `self.state`, and `run_update` flags an `update` that
rebinds the seeded `table`. Added `TestReservedNameCollision`. (25c46a1)
--
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]