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

   ### What changes were proposed in this PR?
   
   Two families of sklearn operators let the column already chosen as the label 
be chosen a second time as an input column, and neither said anything while the 
workflow was being written.
   
   `Target Attribute` names the label and `Text Attribute` names the columns 
`Count Vectorizer` tokenizes, on the fifty-one operators of the Sklearn and 
Sklearn Training groups. The generated code drops the target before the text 
pipeline reads its columns, so naming it there asks the pipeline for a column 
that is no longer present and the run ends with `ValueError: A given column is 
not a column of the dataframe`, which names neither field. Failing is right, 
since vectorizing the label would train a model on the answer, so the pairing 
is refused at compile time instead, in the same `getOutputSchemas` that already 
refuses `Count Vectorizer` on the two Gaussian Naive Bayes operators. Only 
while the vectorizer is on: with it off nothing reads `text` and the panel 
hides it, so a value left behind by an earlier configuration must not report 
the operator invalid.
   
   `Ground Truth Attribute Column` names the label and `Selected Features` 
names the columns handed to `fit`, on the four advanced trainers. Here nothing 
failed at all. The features go to `fit` as they are named, so the ground truth 
among them is the answer given to the estimator as an input, and the model 
scores far better than what it learned deserves. On two hundred rows whose 
label is random noise, a KNN classifier reaches 0.685 train accuracy on the two 
real features and 0.995 once the label is included, and nothing in the run says 
why. `selectedFeatures` defaults to null, so the check reads it through an 
`Option` rather than assuming a list is there.
   
   Both messages name the column and both fields, and say what to change.
   
   ### Any related issues, documentation, discussions?
   
   Closes #8010.
   
   ### How was this PR tested?
   
   `SklearnModelOpDescSpec` gains three cases: the target named as a text 
column is refused, text columns that are not the target are let through, and a 
stale text column is left alone while `Count Vectorizer` is off. 
`SklearnMLOperatorDescriptorSpec` gains two: the ground truth named as a 
feature is refused, and features that do not include it are let through. Both 
files already owned the assertions on the `getOutputSchemas` these checks live 
in. `WorkflowOperator/test` passes: 2381 tests.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 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