aglinxinyuan opened a new pull request, #5697:
URL: https://github.com/apache/texera/pull/5697
### What changes were proposed in this PR?
Pin behavior of four previously-uncovered Jackson-annotated config classes
that back visualization operators in
`common/workflow-operator/operator/visualization/`. No production-code changes.
| Spec | Source class | Tests |
| --- | --- | --- |
| `TablesConfigSpec` | `TablesConfig` | 7 |
| `NestedTableConfigSpec` | `NestedTableConfig` | 9 |
| `FigureFactoryTableConfigSpec` | `FigureFactoryTableConfig` | 7 |
| `DumbbellDotConfigSpec` | `DumbbellDotConfig` | 9 |
All four spec files follow the `<srcClassName>Spec.scala` one-to-one
convention.
**Behavior pinned (each class)**
| Surface | Contract |
| --- | --- |
| Default field values | empty strings on a fresh instance |
| Mutability | `var` fields are assignable post-construction |
| JSON round-trip via `objectMapper.writeValueAsString` + `readValue` |
preserves every field |
| `@JsonProperty(required = true)` annotation | present on every documented
required field — verified via reflection |
| Distinct instances | no static-field leakage across `new` calls |
**Per-class specifics**
| Spec | Additional pins |
| --- | --- |
| `TablesConfigSpec` | `@NotNull` annotation on `attributeName` (jakarta
validation) |
| `NestedTableConfigSpec` | `newName` serializes under wire-key `name` (per
`@JsonProperty(value = "name")`); the field name `newName` MUST NOT appear as a
JSON key; deserialization from `{"name":...}` re-populates `newName` |
| `FigureFactoryTableConfigSpec` | `@AutofillAttributeName` annotation on
`attributeName` (UI dropdown contract) |
| `DumbbellDotConfigSpec` | `dotValue` serializes under wire-key `dot`;
`@NotNull` + `@AutofillAttributeName` annotations; class-level
`@JsonSchemaInject` restricts `dot` to integer/long/double attribute types |
### Any related issues, documentation, discussions?
Closes #5694.
### How was this PR tested?
Pure unit-test additions; verified locally with:
- `sbt "WorkflowOperator/testOnly
org.apache.texera.amber.operator.visualization.tablesChart.TablesConfigSpec
org.apache.texera.amber.operator.visualization.nestedTable.NestedTableConfigSpec
org.apache.texera.amber.operator.visualization.figureFactoryTable.FigureFactoryTableConfigSpec
org.apache.texera.amber.operator.visualization.dumbbellPlot.DumbbellDotConfigSpec"`
— 32 tests, all green
- `sbt scalafmtCheckAll` — clean
- CI to confirm
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.7 [1M context])
--
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]