kz930 opened a new issue, #7244:
URL: https://github.com/apache/texera/issues/7244
### What happened?
Both operators report an unusable input by calling `self.render_error(...)`,
but neither generated class defines that method and `UDFTableOperator` does not
provide one, so the branch meant to explain "no chart" raises `AttributeError`
instead.
`common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/tablesChart/TablesPlotOpDesc.scala`
```scala
| if table.empty:
| yield {'html-content': self.render_error("input table is
empty.")}
| return
|
| ${manipulateTable()}
|
| if table.empty:
| yield {'html-content': self.render_error("value column contains
only non-positive numbers or nulls.")}
```
The generated class contains one method:
```python
class TableChartOperator(UDFTableOperator):
def process_table(self, table: Table, port: int) ->
Iterator[Optional[TableLike]]:
if table.empty:
yield {'html-content': self.render_error("input table is empty.")}
```
Executing it with an empty table raises the error below.
`FigureFactoryTableOpDesc` has the same two call sites with the same omission.
Both messages are therefore unreachable: an empty input, and an input whose
configured columns are all null, fail the operator rather than rendering the
page the code intends.
Every other visualization operator that renders an error page defines
`render_error` inside its own generated class (BarChart, GaugeChart, DotPlot
and so on), so the fix is the same three lines those carry.
### How to reproduce?
1. Build a workflow with any source into TablesPlot, and pick a column under
Included Columns.
2. Filter the input down to zero rows — a Filter whose predicate matches
nothing will do — and run the workflow.
The operator fails with the error below instead of showing "input table is
empty.". The same happens for FigureFactoryTable, and for either operator when
the configured column holds only nulls.
### Version/Branch
main
### Commit Hash (Optional)
348fa8844
### Relevant log output
```
AttributeError: 'TableChartOperator' object has no attribute 'render_error'
```
--
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]