The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
1c6021c543669271f8d441354db6a830ed0446bc / Xinyuan Lin <[email protected]>
test(workflow-core): add unit test coverage for TupleUtils (#4910)

### What changes were proposed in this PR?

Adds `TupleUtilsSpec` covering `TupleUtils`
(common/workflow-core/src/main/scala/org/apache/texera/amber/core/tuple/TupleUtils.scala).
Today the only exercise of `tuple2json` / `json2tuple` is a single
round-trip inside `TupleSpec`; this PR adds dedicated edge-case
coverage.

The new spec pins:
- `tuple2json`: emits one JSON field per schema attribute in the
schema's declared order; `fieldVals` are indexed via
`schema.getIndex(name)` so a reordered schema selects different slots;
null field values become JSON null; an empty schema yields an empty JSON
object.
- `json2tuple`: schema is inferred from a flat JSON object's keys +
types; values round-trip with `tuple2json`; non-object roots (e.g. JSON
arrays) yield an empty tuple rather than silently succeeding with a
populated one; malformed JSON throws.

No production code changed; this is test-only.

### Any related issues, documentation, discussions?

Closes #4909

### How was this PR tested?

Added 8 new unit tests in `TupleUtilsSpec`. Verified locally:

```
sbt 'WorkflowCore/Test/testOnly 
org.apache.texera.amber.core.tuple.TupleUtilsSpec'
# → Tests: succeeded 8, failed 0

sbt 'WorkflowCore/Test/scalafmtCheck'
# → clean
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/25308198107

With regards,
GitHub Actions via GitBox

Reply via email to