aglinxinyuan opened a new issue, #9358:
URL: https://github.com/apache/texera/issues/9358

   ### Feature Summary
   
   Inside a control block (`Loop Start ... Loop End`), #8671 lets a text 
property of an operator whose Scala descriptor generates Python hold a 
loop-variable reference such as `$i` (#8669). A number or true/false property, 
such as Radar Chart's Fill Opacity or Radar Plot's Show Legend, still cannot. 
The descriptor writes its value into the code when the workflow is compiled, 
before the loop runs, so the compiler rejects the reference.
   
   ```
   Loop Start (o = 0.25) -> Radar Chart (fill opacity = $o) -> Loop End
   main:        compile error, "its code is generated before the loop runs"
   with #8671:  compile error, "numeric and boolean properties are written into 
its generated code before the loop runs"
   after:       each iteration draws its chart with its own opacity
   ```
   
   ### Proposed Solution or Design
   
   The property holds a placeholder when the code is generated. Generate the 
code from copies of the descriptor with two probe values in the reference's 
place. Where the two codes differ by exactly the value, and nowhere else, read 
it from the iteration's state instead (`self.loop_variable_value('o', 
'number')`), converted as a JVM operator's property takes it 
(`StateReferenceBinding`). As for #8671's text references, the value is the one 
the operator holds when its first tuple arrives, kept for the rest of the 
iteration.
   
   The reference stays a compile error that names the property and why when:
   - the descriptor checks or adjusts the value;
   - the value lands inside a text, a comment or a name;
   - the code computes with the value, never holds it, or reads it as the 
operator starts;
   - the value decides the output schema.
   
   No error may quote the descriptor's own message about a probe value the user 
never typed. The compile probes the descriptor once and decides every reason in 
one place.
   
   Depends on #8671 and #8642.
   
   ### Affected Area
   
   Workflow Engine (Amber)
   


-- 
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]

  • [I] Bind loop variables... aglinxinyuan (via GitHub) via notifications

Reply via email to