aglinxinyuan opened a new pull request, #5878: URL: https://github.com/apache/texera/pull/5878
### What changes were proposed in this PR? Pin behavior of three previously-untested machine-learning operator types in `common/workflow-operator/machineLearning/`. No production-code changes. | Spec | Source class | Tests | | --- | --- | --- | | `MachineLearningScorerOpDescSpec` | `MachineLearningScorerOpDesc` | 6 | | `HyperParametersSpec` | `HyperParameters` | 5 | | `SklearnMLOperatorDescriptorSpec` | `SklearnMLOperatorDescriptor` (abstract base) | 3 | **Behavior pinned** | Surface | Contract | | --- | --- | | `MachineLearningScorerOpDesc` | operatorInfo (`Machine Learning Scorer`, MACHINE_LEARNING_GENERAL_GROUP); `getOutputSchemas` branches — classification → a `Class` column, regression → empty; `generatePythonCode` structure; round-trip | | `HyperParameters` | generic config bag — `parameter`/`attribute`/`value` null defaults + `parametersSource == false`; `@JsonProperty` wire-keys; `Include.NON_NULL` omits null fields on a fresh instance; populated round-trip | | `SklearnMLOperatorDescriptor` | abstract base — operatorInfo derived from the subclass (`training` + `parameter` inputs depending in order, one output, ADVANCED_SKLEARN_GROUP); fixed `Model`/`Parameters` `getOutputSchemas`; base-field defaults | **Note for reviewers:** `SklearnMLOperatorDescriptor` is abstract, so its base contract is exercised through a **real** concrete subclass (`SklearnAdvancedKNNClassifierTrainerOpDesc`) rather than a test stub — a stub placed under `org.apache.texera.amber.operator.*` would be picked up by `PythonCodeRawInvalidTextSpec`'s classpath scanner (which instantiates every `PythonOperatorDescriptor` and runs `py_compile`). Using a real subclass keeps the spec off that scanner. ### Any related issues, documentation, discussions? Closes #5875. ### How was this PR tested? - `sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.machineLearning.Scorer.MachineLearningScorerOpDescSpec org.apache.texera.amber.operator.machineLearning.sklearnAdvanced.base.HyperParametersSpec org.apache.texera.amber.operator.machineLearning.sklearnAdvanced.base.SklearnMLOperatorDescriptorSpec"` — 14 tests, all green - `sbt "WorkflowOperator/Test/scalafmtCheck"` and `sbt "WorkflowOperator/Test/scalafix --check"` — clean - CI to confirm ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8 [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]
