Yicong-Huang opened a new issue, #4808:
URL: https://github.com/apache/texera/issues/4808
### What happened?
Most visualization operator descriptors under
`common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/`
define `getOutputSchemas` like this:
```scala
override def getOutputSchemas(
inputSchemas: Map[PortIdentity, Schema]
): Map[PortIdentity, Schema] = {
val outputSchema = Schema().add("html-content", AttributeType.STRING)
Map(operatorInfo.outputPorts.head.id -> outputSchema)
Map(operatorInfo.outputPorts.head.id -> outputSchema) // ← unreachable
duplicate
}
```
The first `Map(...)` is computed and discarded; only the second (identical)
expression is the actual return value. This is dead code that almost certainly
came from a copy-paste, and it appears in 29 files across the visualization
package.
### How to reproduce?
```
$ grep -c "Map(operatorInfo.outputPorts.head" \
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/visualization/**/*.scala
\
| grep ":2"
```
29 OpDesc files print `:2`, meaning each one contains two identical
`Map(...)` expressions back-to-back. Files known affected include
`ImageVisualizerOpDesc`, `FunnelPlotOpDesc`, `VolcanoPlotOpDesc`,
`HeatMapOpDesc`, `BarChartOpDesc`, `LineChartOpDesc`, `PieChartOpDesc`,
`BoxViolinPlotOpDesc`, `WaterfallChartOpDesc`, and others. (`BulletChartOpDesc`
does not have the duplicate.)
### Version
1.1.0-incubating (Pre-release/Master)
--
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]