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

   ### What changes were proposed in this PR?
   The 51 per-model sklearn descriptor specs (25 classifiers, 26 training-only 
descriptors) each repeated the same five tests. A new test trait, 
`SklearnModelOpDescBehaviors`, registers them. Each spec now makes one 
`sklearnClassifier(...)` or `sklearnTrainer(...)` call with its own model name 
and sklearn import written out as literals.
   
   | Surface | Pinned |
   | --- | --- |
   | `operatorInfo` | name, description, group, input port names, one blocking 
output |
   | config defaults | `countVectorizer`, `tfidfTransformer`, `target`, `text` |
   | `getOutputSchemas` | `model_name` STRING and `model` BINARY on the 
declared output port |
   | `generatePythonCode` | the estimator import, `make_pipeline`, the model 
name |
   | JSON | the `operatorType` discriminator and a round-trip through 
`LogicalOp` |
   
   Test names are unchanged (`<Descriptor>[.<member>] should ...`). The seven 
specs with extra tests (the naive Bayes family and the decision tree) keep 
them. Expected values stay literal in each spec, so a renamed model or a 
changed import still fails that model's own spec. `sklearnClassifier` only 
accepts a `SklearnClassifierOpDesc` and `sklearnTrainer` only a 
`SklearnTrainingOpDesc`, so a descriptor cannot be checked against the wrong 
family's ports and group.
   
   ### Any related issues, documentation, discussions?
   Closes #9201.
   
   ### How was this PR tested?
   - `sbt "WorkflowOperator/testOnly 
org.apache.texera.amber.operator.sklearn.*"`: 58 suites, 431 tests pass. These 
are the same 431 test names as on main, compared from the JUnit XML reports 
before and after.
   - Mutation check: a wrong model name in `SklearnBaggingOpDescSpec` fails its 
`operatorInfo` and `generatePythonCode` tests, and a wrong import in 
`SklearnTrainingKNNOpDescSpec` fails its `generatePythonCode` test; the other 
tests in both specs pass.
   - `sbt "WorkflowOperator/Test/scalafmtCheck" "WorkflowOperator/Test/scalafix 
--check"`
   
   ### Was this PR authored or co-authored using generative AI tooling?
   Generated-by: Claude Code (Claude Opus 5.5)
   


-- 
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