aglinxinyuan opened a new pull request, #5770:
URL: https://github.com/apache/texera/pull/5770

   ### What changes were proposed in this PR?
   
   Pin behavior of four small contract / config classes in 
`common/workflow-operator/`. Each is too thin to justify its own PR but the 
bundle stays cohesive (everything sits in the descriptor / metadata surface). 
No production-code changes.
   
   | Spec | Source class | Tests |
   | --- | --- | --- |
   | `SourceOperatorDescriptorSpec` | `SourceOperatorDescriptor` (abstract) | 4 
|
   | `PythonSourceOperatorDescriptorSpec` | `PythonSourceOperatorDescriptor` 
(abstract) | 5 |
   | `GaugeChartStepsSpec` | `GaugeChartSteps` (Jackson bag) | 7 |
   | `DummyPropertiesSpec` | `DummyProperties` (Jackson bag) | 7 |
   
   All four spec files follow the `<srcClassName>Spec.scala` one-to-one 
convention.
   
   **Behavior pinned — `SourceOperatorDescriptor`**
   
   | Surface | Contract |
   | --- | --- |
   | `sourceSchema()` | declared as an abstract member; pinned via a minimal 
test-only concrete subclass |
   | `LogicalOp` inheritance | upcast compiles; `case _: LogicalOp` and `case 
_: SourceOperatorDescriptor` both match a concrete instance |
   
   **Behavior pinned — `PythonSourceOperatorDescriptor`**
   
   | Surface | Contract |
   | --- | --- |
   | Composition | a concrete subclass IS a `SourceOperatorDescriptor` AND a 
`PythonOperatorDescriptor` (compile-time enforced + four-way `isInstanceOf` 
check) |
   | Inherited defaults | `parallelizable() == false` and `asSource() == false` 
(the documented base defaults) when the subclass does not override |
   
   **Behavior pinned — `GaugeChartSteps`**
   
   | Surface | Contract |
   | --- | --- |
   | Defaults | `start == ""` and `end == ""` on a fresh instance |
   | Mutability | both fields are `var`-assignable post-construction |
   | JSON wire-keys | serialize under `start` / `end` (Jackson tree-API 
verified) |
   | JSON round-trip | preserves both fields |
   | Annotations | `@JsonProperty("start")` and `@JsonProperty("end")` on the 
corresponding fields (verified via reflection) |
   | Instance independence | no static state shared across `new` |
   
   **Behavior pinned — `DummyProperties`**
   
   | Surface | Contract |
   | --- | --- |
   | Defaults | `dummyProperty == ""` and `dummyValue == ""` |
   | Mutability | both fields are `var`-assignable |
   | JSON round-trip | preserves both fields (including the default-empty 
round-trip) |
   | Annotations | `@JsonProperty` present on both fields |
   | Instance independence | no static state shared across `new` |
   
   ### Any related issues, documentation, discussions?
   
   Closes #5767.
   
   ### How was this PR tested?
   
   Pure unit-test additions; verified locally with:
   
   - `sbt "WorkflowOperator/testOnly 
org.apache.texera.amber.operator.source.SourceOperatorDescriptorSpec 
org.apache.texera.amber.operator.source.PythonSourceOperatorDescriptorSpec 
org.apache.texera.amber.operator.visualization.gaugeChart.GaugeChartStepsSpec 
org.apache.texera.amber.operator.DummyPropertiesSpec"` — 23 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]

Reply via email to