bobbai00 commented on code in PR #6009:
URL: https://github.com/apache/texera/pull/6009#discussion_r3563570173


##########
agent-service/src/agent/tools/result-formatting.spec.ts:
##########
@@ -19,104 +19,120 @@
 
 import { describe, expect, test } from "bun:test";
 import { formatOperatorResult } from "./result-formatting";
-import { WorkflowState } from "../workflow-state";
-import type { OperatorInfo } from "../../types/execution";
-import type { OperatorPredicate, OperatorLink, PortDescription } from 
"../../types/workflow";
+import {
+  ConsoleMessageType,
+  OperatorState,
+  OperatorResultMode,
+  WorkflowFatalErrorType,
+  type OperatorExecutionSummary,
+  type WorkflowFatalError,
+  type SampleRow,
+} from "../../types/execution";
+
+function toSampleRows(rows: Record<string, any>[]): SampleRow[] {
+  return rows.map((tuple, rowIndex) => ({ rowIndex, tuple }));
+}
 
-function makeOpInfo(overrides: Partial<OperatorInfo> = {}): OperatorInfo {
-  return {
-    state: "completed",
-    inputTuples: 0,
-    outputTuples: 0,
-    resultMode: "table",
-    ...overrides,
-  };
+interface OpInfoOverrides {
+  state?: OperatorState;
+  error?: string;
+  outputTuples?: number;
+  tuplesCount?: number;
+  warnings?: string[];
+  result?: Record<string, any>[];
+  sampleTuples?: SampleRow[];

Review Comment:
   changed



-- 
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