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

   ### What happened?
   
   `TablesPlotOpDesc.getAttributes` builds the selected-column list for the 
generated Python by joining the rendered column names with the literal `','`:
   
   
`common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/tablesChart/TablesPlotOpDesc.scala`
   
   ```scala
   private def getAttributes: String =
     includedColumns.map(c => pyb"""${c.attributeName}""").mkString("','")
   ```
   
   used as `table.dropna(subset=[$attributes])` and `table[[$attributes]]`.
   
   Each `pyb"""${c.attributeName}"""` renders to a runtime-decoded call
   `self.decode_python_template('<base64>')`. Joining those with the literal 
`','`
   places a string literal directly after a function call, which is a **Python
   SyntaxError**, so the operator fails to run for any input.
   
   **Expected:** the column list is a valid Python list of the selected column 
names.
   
   ### How to reproduce?
   
   **A — user-facing:** Add a **Tables Plot** operator, select one or more 
columns, and run. The generated Python fails to execute (SyntaxError).
   
   **B — confirmed against `main`'s operator directly:** construct 
`TablesPlotOpDesc` with `includedColumns` of two columns (`a`, `b`) and call 
`generatePythonCode()`. The emitted lines are:
   
   ```
   table = 
table.dropna(subset=[self.decode_python_template('YQ==')','self.decode_python_template('Yg==')])
   filtered_table = 
table[[self.decode_python_template('YQ==')','self.decode_python_template('Yg==')]]
   ```
   
   (`YQ==`/`Yg==` decode to `a`/`b`.) Each is `decode(...)','decode(...)` — a 
call
   immediately followed by the string literal `','`, which Python rejects with a
   SyntaxError.
   
   **Proposed fix:** join with a plain comma instead of `','`:
   
   ```scala
   includedColumns.map(c => pyb"""${c.attributeName}""").mkString(",")
   ```
   
   which yields the valid 
`subset=[self.decode_python_template('YQ=='),self.decode_python_template('Yg==')]`.
   
   ### Version/Branch
   
   `main` (1.3.0-incubating-SNAPSHOT)
   


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