Misc cleanups for error handling, naming/signatures, and partitioning in skill templates [skip ci]#15116
Conversation
Signed-off-by: Rishi Chandra <rishic@nvidia.com>
There was a problem hiding this comment.
Pull request overview
Follow-up cleanup to the UDF skill templates to align with prior review feedback: clarify naming/signatures, tighten resource ownership expectations, and encourage more realistic test partitioning.
Changes:
- Renamed
verifyUDFResults→assertUDFResultsacross templates/docs to reflect assertion semantics. - Updated Scala test templates to use
repartition(2)to better exercise multi-row columnar execution paths. - Adjusted benchmark template error/report handling and clarified GPU benchmark resource-lifecycle expectations (
executeGpucloses its result and returnsUnit).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| skills/udf-judge-conversion/SKILL.md | Updates judge guidance to reference assertUDFResults instead of verifyUDFResults. |
| skills/udf-gen-test/templates/scala/src/test/scala/com/udf/UnitTest.scala | Renames results-check helper, updates TODO guidance, and changes repartitioning to 2. |
| skills/udf-gen-test/templates/scala/src/test/scala/com/udf/SqlComparisonTest.scala | Updates to assertUDFResults and uses repartition(2) for test input. |
| skills/udf-gen-test/templates/scala/src/test/scala/com/udf/CudfComparisonTest.scala | Updates to assertUDFResults and uses repartition(2) for test input. |
| skills/udf-gen-test/templates/scala/src/main/scala/com/udf/bench/SparkBenchRunner.scala | Stops swallowing report-write exceptions; report writing failures now propagate. |
| skills/udf-gen-test/templates/scala/src/main/scala/com/udf/bench/MicroBenchRunner.scala | Changes executeGpu to Unit and updates docs/call site to reflect internal close of the GPU result. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
build |
Greptile SummaryThis is a housekeeping follow-up that addresses code-review comments from PR #15058, touching only the skill template files and the judge SKILL.md — no production plugin code is changed.
Confidence Score: 4/5Safe to merge; all changes are in skill template files with no impact on the production Spark plugin. The one nuance worth a follow-up is how write errors in the success path are reported. The rename, repartition bump, and executeGpu void-return changes are clean and consistent across all template files. The removal of the silent write-error catch in SparkBenchRunner is an improvement in visibility, but it creates a path where a successful benchmark run can exit with failure status if the JSON write fails — the outer catch handler will log it as a benchmark failure and write an error report rather than surfacing just the write problem. skills/udf-gen-test/templates/scala/src/main/scala/com/udf/bench/SparkBenchRunner.scala — the success-path writeReport call now sits inside the try block that feeds the error handler. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Main as SparkBenchRunner.main
participant Job as Spark Job
participant WR as writeReport
participant EH as catch(Exception)
Main->>Job: execute benchmark
Job-->>Main: success / elapsed
Main->>WR: "writeReport(status=success)"
alt write succeeds
WR-->>Main: ok
Main->>Main: sys.exit(0)
else write throws IOException
WR-->>EH: IOException (caught by outer catch)
EH->>WR: "writeReport(status=error)"
EH->>Main: sys.exit(1)
Note over EH,Main: benchmark was successful but exits with failure
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Main as SparkBenchRunner.main
participant Job as Spark Job
participant WR as writeReport
participant EH as catch(Exception)
Main->>Job: execute benchmark
Job-->>Main: success / elapsed
Main->>WR: "writeReport(status=success)"
alt write succeeds
WR-->>Main: ok
Main->>Main: sys.exit(0)
else write throws IOException
WR-->>EH: IOException (caught by outer catch)
EH->>WR: "writeReport(status=error)"
EH->>Main: sys.exit(1)
Note over EH,Main: benchmark was successful but exits with failure
end
|
wjxiz1992
left a comment
There was a problem hiding this comment.
good practices, LGTM!
Description
This is a follow-up to address a few comments on #15058.
verifyUDFResults->assertUDFResultsto clarify that this calls assertionsrepartition(2)and encouraging 10+ test cases, for more realistic parallelism while ensuring the UDF is actually fed multi-row columnsChecklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance