This is an automated email from the ASF dual-hosted git repository.

linxinyuan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git


The following commit(s) were added to refs/heads/main by this push:
     new 264b72f666 fix: syntax for accessing DataFrame column in 
SklearnTrainingOpDesc (#4237)
264b72f666 is described below

commit 264b72f666d5a1c83dd12af198e80f0f5b8810b9
Author: Xinyuan Lin <[email protected]>
AuthorDate: Thu Feb 26 23:05:39 2026 -0800

    fix: syntax for accessing DataFrame column in SklearnTrainingOpDesc (#4237)
    
    ### What changes were proposed in this PR?
    Update the syntax for accessing the DataFrame column in
    SklearnTrainingOpDesc, following the Python template introduced
    recently.
    
    
    ### Any related issues, documentation, discussions?
    Sklearn Training operators no longer work after PR#4189
    
    
    ### How was this PR tested?
    Tested manually.
    
    
    ### Was this PR authored or co-authored using generative AI tooling?
    No.
    
    Signed-off-by: Xinyuan Lin <[email protected]>
---
 .../texera/amber/operator/sklearn/training/SklearnTrainingOpDesc.scala  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/sklearn/training/SklearnTrainingOpDesc.scala
 
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/sklearn/training/SklearnTrainingOpDesc.scala
index c0d1fd3a51..a00cc7ec9c 100644
--- 
a/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/sklearn/training/SklearnTrainingOpDesc.scala
+++ 
b/common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/sklearn/training/SklearnTrainingOpDesc.scala
@@ -98,7 +98,7 @@ class SklearnTrainingOpDesc extends PythonOperatorDescriptor {
        |    def process_table(self, table: Table, port: int) -> 
Iterator[Optional[TableLike]]:
        |        Y = table[$target]
        |        X = table.drop($target, axis=1)
-       |        X = ${if (countVectorizer) "X[" + text + "]" else "X"}
+       |        X = ${if (countVectorizer) pyb"X[$text]" else "X"}
        |        model = make_pipeline(${if (countVectorizer) 
"CountVectorizer()," else ""} ${if (
       tfidfTransformer
     ) "TfidfTransformer(),"

Reply via email to