You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "PG1204 (via GitHub)" <gi...@apache.org> on 2026/09/28 00:50:27 UTC

[I] Align schema validation across the four legacy Hugging Face operators [texera]

PG1204 opened a new issue, #8728:
URL: https://github.com/apache/texera/issues/8728

   ### Task Summary
   
   ### Task Summary
   
   The four legacy Hugging Face operators validate their configuration in three different ways and none of them check the input column they read. Bring them to one contract.
   
   ### Context
   
   `getOutputSchemas` behaves differently in each operator when a result attribute is empty:
   
   - `HuggingFaceSpamSMSDetectionOpDesc` and `HuggingFaceSentimentAnalysisOpDesc` `return null`
   - `HuggingFaceTextSummarizationOpDesc` throws `RuntimeException("Result attribute name should be given")`
   - `HuggingFaceIrisLogisticRegressionOpDesc` throws `RuntimeException("Result attribute name should not be empty")`
   
   Returning `null` is an outlier in the codebase: of the 61 operators implementing `getOutputSchemas`, only these two do it. Six throw and one uses `require`.
   
   `HuggingFaceTextSummarizationOpDesc` also still reads the input schema as `inputSchemas.values.head` rather than `inputSchemas(operatorInfo.inputPorts.head.id)`, which is what #8482 corrected in the spam operator. With one input port the two are equivalent, so this is consistency rather than a live defect.
   
   Separately, none of the four validate that the column they read exists in the input schema, `attribute` for the three text operators, and the four numeric columns for iris. A typo surfaces as an error from the generated Python at run time instead of a clear message at build time. #7299 added exactly that check to the Hugging Face inference operator and is the precedent to follow.
   
   ### Proposed change
   
   Pick one contract for all four and apply it, then add a check that the referenced input columns exist (and are numeric, for iris).
   
   The contract is the open question and wants a maintainer's steer: `null` matches the two HF operators but almost nothing else in the repo, while throwing matches the six operators that do validate. `getOutputSchemas` is called while an operator is still being configured, so whichever is chosen must stay quiet for a half-filled operator.
   
   ### Required test
   
   Extend each operator's spec to cover the empty and missing-column cases for the chosen contract, and keep the existing happy-path assertions.
   
   
   ### Task Type
   
   - [x] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [ ] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other


-- 
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: notifications-unsubscribe@texera.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Align schema validation across the four legacy Hugging Face operators [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8728:
URL: https://github.com/apache/texera/issues/8728#issuecomment-5861419680

   <!-- texera:template-compliance -->
   đź‘‹ Thanks for opening this issue, @PG1204!
   
   It looks like the issue description doesn't quite follow our template yet:
   
   - The **Task Summary** section is empty; please fill it in.
   
   Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
   
   You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
   


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Align schema validation across the four legacy Hugging Face operators [texera]

Posted by "Ma77Ball (via GitHub)" <gi...@apache.org>.
Ma77Ball commented on issue #8728:
URL: https://github.com/apache/texera/issues/8728#issuecomment-6132111330

   @PG1204 
   
   - For question 1, I recommend sticking with throw, as it stores the error on the output port, which is the operator's built-in "operator not ready yet" path. This error-handling approach also gives the user a human-readable message rather than a null pointer exception. So please move all four to throw, matching the 6 existing operators and #7299 (require is fine too; it just throws IllegalArgumentException).
   
   - For question 2, I recommend sticking to one PR (assuming it is not massive >2000 lines of code) as it will help with the review process and confirm the contract is uniform. Stacked PRs are also tedious and take a lot of effort from both the reviewer and the developer (so I'd like to avoid that here). 


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Align schema validation across the four legacy Hugging Face operators [texera]

Posted by "PG1204 (via GitHub)" <gi...@apache.org>.
PG1204 commented on issue #8728:
URL: https://github.com/apache/texera/issues/8728#issuecomment-5861419704

   /take


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Align schema validation across the four legacy Hugging Face operators [texera]

Posted by "PG1204 (via GitHub)" <gi...@apache.org>.
PG1204 commented on issue #8728:
URL: https://github.com/apache/texera/issues/8728#issuecomment-6489131733

   > [@PG1204](https://github.com/PG1204)
   > 
   > * For question 1, I recommend sticking with throw, as it stores the error on the output port, which is the operator's built-in "operator not ready yet" path. This error-handling approach also gives the user a human-readable message rather than a null pointer exception. So please move all four to throw, matching the 6 existing operators and [fix(workflow-operator): report a clear error when a configured HF image/audio column is missing #7299](https://github.com/apache/texera/pull/7299) (require is fine too; it just throws IllegalArgumentException).
   > * For question 2, I recommend sticking to one PR (assuming it is not massive >2000 lines of code) as it will help with the review process and confirm the contract is uniform. Stacked PRs are also tedious and take a lot of effort from both the reviewer and the developer (so I'd like to avoid that here).
   
   @Ma77Ball thanks for the recommendations.


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Align schema validation across the four legacy Hugging Face operators [texera]

Posted by "PG1204 (via GitHub)" <gi...@apache.org>.
PG1204 commented on issue #8728:
URL: https://github.com/apache/texera/issues/8728#issuecomment-5862223997

   hi @Ma77Ball & @xuang7 
   
   I wanted to clarify two things before I start this.
   
   1. Which contract should be standardized on when a result attribute is empty? Today Spam and Sentiment `return null`, while Summarization and Iris throw. Repo-wide, only those two HF operators return `null` out of 61 operators implementing `getOutputSchemas`; 6 throw and 1 uses `require`. Since `getOutputSchemas` runs while an operator is still being configured, the choice depends on what the compiler does with each mid-edit, which I can't tell from the code.
   
   2. Is it alright to change all four legacy HF operators in one PR, or would you rather I keep it to one and follow up separately?
   
   Either answer rewrites behavior that's already merged, so I'd rather follow your preference than pick one.
   


-- 
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: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org