Yicong-Huang commented on code in PR #6009:
URL: https://github.com/apache/texera/pull/6009#discussion_r4499104922


##########
agent-service/src/agent/tools/result-formatting.spec.ts:
##########
@@ -316,90 +260,61 @@ describe("jsonToTableFormat - row index gaps", () => {
     expect(lines[lines.length - 1]).toBe("5\tb");
   });
 
-  test("no separator is emitted between consecutive __row_index__ values", () 
=> {
+  test("no separator is emitted between consecutive rowIndex values", () => {
     const out = formatOperatorResult(
       "op1",
       makeOpInfo({
         outputTuples: 2,
-        result: [
-          { __row_index__: 0, v: "a" },
-          { __row_index__: 1, v: "b" },
+        sampleTuples: [
+          [0, recordToTuple({ v: "a" })],
+          [1, recordToTuple({ v: "b" })],
         ],
-      }),
-      EMPTY_STATE
+      })
     );
     expect(out).not.toContain("...\t...");
   });
 
-  test("non-zero starting __row_index__ does not emit a leading gap marker", 
() => {
+  test("non-zero starting rowIndex does not emit a leading gap marker", () => {
     const out = formatOperatorResult(
       "op1",
-      makeOpInfo({ outputTuples: 1, result: [{ __row_index__: 9, v: "z" }] }),
-      EMPTY_STATE
+      makeOpInfo({ outputTuples: 1, sampleTuples: [[9, recordToTuple({ v: "z" 
})]] })
     );
     expect(out).not.toContain("...\t...");
     expect(out.endsWith("9\tz")).toBe(true);
   });
 });
 
-describe("formatInputOutputMetadata", () => {
-  test("returns only output shape when inputPortShapes is empty or undefined", 
() => {
-    const opInfo = makeOpInfo({ outputTuples: 5 });
-    expect(formatInputOutputMetadata(EMPTY_STATE, "op1", opInfo, 
3)).toBe("Output table shape: (5, 3)");
-  });
-
-  test("resolves upstream operators and sorts input ports by index", () => {
-    const state = new WorkflowState();
-    state.addOperator(makeOperator("src0"));
-    state.addOperator(makeOperator("src1"));
-    state.addOperator(makeOperator("op1", ["in-0", "in-1"]));
-    state.addLink(makeLink("l0", ["src0", "output-0"], ["op1", "in-0"]));
-    state.addLink(makeLink("l1", ["src1", "output-0"], ["op1", "in-1"]));
-
-    const opInfo = makeOpInfo({
-      totalRowCount: 10,
-      inputPortShapes: [
-        { portIndex: 1, rows: 20, columns: 2 },
-        { portIndex: 0, rows: 30, columns: 4 },
-      ],
-    });
-
-    const out = formatInputOutputMetadata(state, "op1", opInfo, 5);
-    expect(out).toBe("Input operator(table shape): src0(30, 4), src1(20, 
2)\nOutput table shape: (10, 5)");
-  });
-});
-
-describe("jsonToTableFormat", () => {
-  test("returns empty string for empty array or rows with no visible headers", 
() => {
-    expect(jsonToTableFormat([])).toBe("");
-    expect(jsonToTableFormat([{ __row_index__: 0, __is_visualization__: true 
}])).toBe("");
+describe("formatSampleTuplesAsTsv", () => {

Review Comment:
   **Advisory:**
   
   These two describes test helpers from tools-utility.ts 
(formatSampleTuplesAsTsv and formatOperatorOutput), but they live in 
result-formatting.spec.ts. tools-utility.spec.ts already covers the sibling 
helpers and has no describes for these two, so moving both describes there 
keeps each suite with the module it covers.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to