You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/07/08 00:40:54 UTC
[I] add unit test coverage for QaRankingCodegen [texera]
aglinxinyuan opened a new issue, #6249:
URL: https://github.com/apache/texera/issues/6249
### Task Summary
Add a dedicated `QaRankingCodegenSpec.scala` that pins the payload/parse Python-snippet contract of `QaRankingCodegen` — the Hugging Face codegen for the question-answering / ranking task family. Mirror the existing `TextGenCodegenSpec` (same package) as the template.
## Background
`QaRankingCodegen` (`common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/codegen/QaRankingCodegen.scala`) is an `object extends TaskCodegen`. It produces two Python source snippets — `payloadPython(ctx)` and `parsePython(ctx)` — that are spliced into the generated inference operator. It handles five HF pipeline tasks and, like every codegen, must reference `self.*` attributes rather than inlining raw user strings from the `CodegenContext`.
```scala
override val task: String = "question-answering"
override val tasks: Set[String] = Set(
"question-answering", "table-question-answering",
"zero-shot-classification", "sentence-similarity", "text-ranking"
)
```
## Behavior to pin
| Member | Contract |
| --- | --- |
| `task` | equals `"question-answering"` |
| `tasks` | equals exactly the 5-element set above |
| `payloadPython` | opens with `if task == "question-answering":`; has an `elif` branch for table-QA, zero-shot, sentence-similarity and text-ranking; ends with the `else: payload = {"inputs": prompt_value}` fallback |
| `parsePython` | the QA / table-QA branches read `body.get("answer", ...)`; zero-shot / sentence-similarity / text-ranking return `json.dumps(body)` |
| no raw-value leakage | with sentinel `CodegenContext` string fields (e.g. `contextColumn` / `candidateLabels` / `sentencesColumn` set to distinctive `"MARKER_…"` values), neither snippet contains the sentinel — the code references `self.CONTEXT_COLUMN` / `self.CANDIDATE_LABELS` / `self.SENTENCES_COLUMN` instead |
Build the `CodegenContext` with a small `makeCtx` helper exactly like `TextGenCodegenSpec` (set `task = "question-answering"` plus the QA-specific columns). Assert on snippet structure / marker substrings, not on exact whitespace.
## Scope
- New spec: `QaRankingCodegenSpec.scala` under `common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/huggingFace/codegen/`.
- No production-code changes.
### Task Type
- [ ] Refactor / Cleanup
- [ ] DevOps / Deployment / CI
- [x] 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] add unit test coverage for QaRankingCodegen [texera]
Posted by "PG1204 (via GitHub)" <gi...@apache.org>.
PG1204 commented on issue #6249:
URL: https://github.com/apache/texera/issues/6249#issuecomment-5172639948
/untake
--
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] add unit test coverage for QaRankingCodegen [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6249:
URL: https://github.com/apache/texera/issues/6249#issuecomment-4910330808
<!-- texera:template-compliance -->
👋 Thanks for opening this issue, @aglinxinyuan!
It looks like the issue description doesn't quite follow our template yet:
- This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.
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] add unit test coverage for QaRankingCodegen [texera]
Posted by "PG1204 (via GitHub)" <gi...@apache.org>.
PG1204 commented on issue #6249:
URL: https://github.com/apache/texera/issues/6249#issuecomment-5061944946
@aglinxinyuan #6655 (raised by @Ma77Ball) added test coverage for QaRankingCodegen, this issue can be closed.
--
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] add unit test coverage for QaRankingCodegen [texera]
Posted by "PG1204 (via GitHub)" <gi...@apache.org>.
PG1204 commented on issue #6249:
URL: https://github.com/apache/texera/issues/6249#issuecomment-4965713733
/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