File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -1264,7 +1264,7 @@ export async function writeScratchpadResult(
12641264 let errorMsg ;
12651265
12661266 if ( result . error ) {
1267- errorMsg = result . errorMsg ;
1267+ errorMsg = "Error: " + result . errorMsg ;
12681268
12691269 if ( result . stacktrace ) {
12701270 errorMsg =
Original file line number Diff line number Diff line change @@ -191,14 +191,24 @@ export class KdbResultsViewProvider implements WebviewViewProvider {
191191 }
192192
193193 updatedExtractRowData ( results : StructuredTextResults ) {
194- const { columns, count } = results ;
194+ const { columns } = results ;
195+ const columnsArray = Array . isArray ( columns ) ? columns : [ columns ] ;
196+
197+ let dataLength = 0 ;
198+ if ( columnsArray . length > 0 ) {
199+ const firstColumnValues = columnsArray [ 0 ] . values ;
200+ if ( Array . isArray ( firstColumnValues ) ) {
201+ dataLength = firstColumnValues . length ;
202+ } else {
203+ dataLength = 1 ;
204+ }
205+ }
206+
195207 const rowData : { [ key : string ] : any } [ ] = Array . from (
196- { length : count } ,
208+ { length : dataLength } ,
197209 ( ) => ( { } ) ,
198210 ) ;
199211
200- const columnsArray = Array . isArray ( columns ) ? columns : [ columns ] ;
201-
202212 columnsArray . forEach ( ( column ) => {
203213 const { name, values } = column ;
204214 values . forEach ( ( value , index ) => {
You can’t perform that action at this time.
0 commit comments