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


##########
agent-service/src/agent/tools/result-formatting.spec.ts:
##########
@@ -19,104 +19,129 @@
 
 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";
-
-function makeOpInfo(overrides: Partial<OperatorInfo> = {}): OperatorInfo {
+import {
+  ConsoleMessageType,
+  OperatorState,
+  WorkflowFatalErrorType,
+  type OperatorExecutionSummary,
+  type WebOutputMode,
+  type WorkflowFatalError,
+  type Tuple,
+} from "../../types/execution";
+
+// Build an engine-style Tuple with an all-STRING schema from a column->value 
record,
+// matching how the backend emits truncated sampled rows.
+function recordToTuple(row: Record<string, any>): Tuple {
   return {
-    state: "completed",
-    inputTuples: 0,
-    outputTuples: 0,
-    resultMode: "table",
-    ...overrides,
+    schema: { attributes: Object.keys(row).map(name => ({ attributeName: name, 
attributeType: "string" })) },
+    fields: Object.values(row),
   };
 }
 
-function makeOperator(id: string, inputPortIDs: string[] = []): 
OperatorPredicate {
-  const inputPorts: PortDescription[] = inputPortIDs.map((portID, i) => ({
-    portID,
-    displayName: `Input ${i}`,
-  }));
-  return {
-    operatorID: id,
-    operatorType: "TestOp",
-    operatorVersion: "1.0",
-    operatorProperties: {},
-    inputPorts,
-    outputPorts: [{ portID: "output-0", displayName: "Output 0" }],
-    showAdvanced: false,
-  };
+function toSampleRows(rows: Record<string, any>[]): [number, Tuple][] {

Review Comment:
   renamed



##########
frontend/src/app/workspace/component/agent/agent-interaction/agent-interaction.component.ts:
##########
@@ -192,95 +191,34 @@ export class AgentInteractionComponent implements OnInit, 
OnChanges {
   }
 
   /**
-   * Get column names from sample records, placing __row_index__ first 
(displayed as "Row").
+   * Get visible column names from sample rows.

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