Copilot commented on code in PR #5075:
URL: https://github.com/apache/texera/pull/5075#discussion_r3251546743
##########
agent-service/src/agent/tools/workflow-execution-tools.ts:
##########
@@ -397,7 +397,7 @@ function jsonToTableFormat(jsonResult: Record<string,
any>[]): string {
if (!jsonResult || jsonResult.length === 0) return "";
const hasRowIndex = jsonResult.length > 0 && "__row_index__" in
jsonResult[0];
- const headers = Object.keys(jsonResult[0]).filter(h => h !==
"__row_index__");
+ const headers = getVisibleResultHeaders(jsonResult[0]);
Review Comment:
`jsonToTableFormat` can now produce `headers = []` (e.g., when a row only
contains internal keys filtered by `getVisibleResultHeaders`). In that case
this function will still emit a header line of just `"\t"` and rows like
`"0\t"`, which is likely unintended and differs from `result-formatting.ts`
(which returns an empty string when there are no visible headers). Consider
adding an early return when `headers.length === 0` to avoid rendering an empty
table.
--
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]