aglinxinyuan commented on code in PR #4206:
URL: https://github.com/apache/texera/pull/4206#discussion_r3290817410


##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/loop/LoopEndOpDescSpec.scala:
##########
@@ -0,0 +1,152 @@
+/*

Review Comment:
   Both addressed in d41918f461.
   
   **1. Codegen robustness.** Both `LoopStartOpDesc.generatePythonCode` and 
`LoopEndOpDesc.generatePythonCode` are now built with the `pyb"..."` 
interpolator, with `initialization` / `output` / `update` / `condition` typed 
as `EncodableString`. Every user value is base64-encoded at build time and 
rendered as `self.decode_python_template(<b64>)` instead of being inlined as a 
raw quoted substring. A `"` / `` / `\n` / `\` in user input therefore cannot 
escape into the surrounding Python syntax. Added 8 new tests (4 per spec) that 
exercise these exact tricky inputs and assert the raw text is **absent** from 
the generated source while the expected `decode_python_template`-wrapped 
substring is present.
   
   **2. Spec deduplication.** Extracted `LoopOpDescSpecMixin` carrying the 
`workflowId` / `executionId` vals, the `b64` / `decodeExpr` helpers, and the 
shared physical-op assertions (`assertNonParallelizableSingleWorker`, 
`assertPortsCarriedForward`, `assertOpExecWithPythonCodeForClass`, 
`assertUserInputIsBase64Wrapped`). Both specs are now focused on the 
per-operator differences only.



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

Reply via email to