File tree Expand file tree Collapse file tree 5 files changed +29
-4
lines changed
Expand file tree Collapse file tree 5 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 9696 result [`error ]: string result `error ;
9797 if [`backtrace in key result ;
9898 result [`backtrace ]: string result `backtrace ];
99+ if [result `errored ; : result ];
100+ if [type [result [`result ]] = 99h ;
101+ if [`output in key result [`result ];
102+ if [type [result [`result ][`output ]] = 99h ;
103+ if [`bytes in key result [`result ][`output ];
104+ result [`base64 ]: 1b ; result [`result ]: .Q.btoa result [`result ][`output ][`bytes ]; : result ]]]];
99105 result [`result ]:
100106 $ [result `errored ;
101107 :: ;
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ export class LocalConnection {
219219 return { base64, result } ;
220220 }
221221
222- if ( ! stringify ) {
222+ if ( ! stringify && ! isPython ) {
223223 return JSON . parse ( result ) ;
224224 }
225225
Original file line number Diff line number Diff line change @@ -1224,6 +1224,7 @@ export async function writeQueryResultsToView(
12241224 result ,
12251225 isInsights ,
12261226 connVersion ,
1227+ isPython ,
12271228 ) ;
12281229 if ( ! checkIfIsDatasource ( type ) ) {
12291230 addQueryHistory (
Original file line number Diff line number Diff line change @@ -209,8 +209,18 @@ export async function activate(context: ExtensionContext) {
209209 ) ,
210210 commands . registerCommand (
211211 "kdb.resultsPanel.update" ,
212- ( results : any , isInsights : boolean , connVersion ?: number ) => {
213- ext . resultsViewProvider . updateResults ( results , isInsights , connVersion ) ;
212+ (
213+ results : any ,
214+ isInsights : boolean ,
215+ connVersion ?: number ,
216+ isPython ?: boolean ,
217+ ) => {
218+ ext . resultsViewProvider . updateResults (
219+ results ,
220+ isInsights ,
221+ connVersion ,
222+ isPython ,
223+ ) ;
214224 } ,
215225 ) ,
216226 commands . registerCommand ( "kdb.resultsPanel.clear" , ( ) => {
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import { decodeQUTF } from "../utils/decode";
3131export class KdbResultsViewProvider implements WebviewViewProvider {
3232 public static readonly viewType = "kdb-results" ;
3333 public isInsights = false ;
34+ public isPython = false ;
3435 public _colorTheme : any ;
3536 private _view ?: WebviewView ;
3637 private _results : string | string [ ] = "" ;
@@ -97,10 +98,12 @@ export class KdbResultsViewProvider implements WebviewViewProvider {
9798 queryResults : any ,
9899 isInsights ?: boolean ,
99100 connVersion ?: number ,
101+ isPython ?: boolean ,
100102 ) {
101103 if ( this . _view ) {
102104 this . _view . show ?.( true ) ;
103105 this . isInsights = ! ! isInsights ;
106+ this . isPython = ! ! isPython ;
104107 this . updateWebView ( queryResults , connVersion ) ;
105108 }
106109 }
@@ -231,11 +234,15 @@ export class KdbResultsViewProvider implements WebviewViewProvider {
231234 results : any ,
232235 isInsights : boolean ,
233236 connVersion ?: number ,
237+ isPython ?: boolean ,
234238 ) : GridOptions {
235239 let rowData = [ ] ;
236240 let columnDefs = [ ] ;
237241
238- if ( ! isInsights || ( connVersion && compareVersions ( connVersion , 1.12 ) ) ) {
242+ if (
243+ ( ! isInsights && ! isPython ) ||
244+ ( isInsights && connVersion && compareVersions ( connVersion , 1.12 ) )
245+ ) {
239246 rowData = this . updatedExtractRowData ( results ) ;
240247 columnDefs = this . updatedExtractColumnDefs ( results ) ;
241248 } else {
@@ -370,6 +377,7 @@ export class KdbResultsViewProvider implements WebviewViewProvider {
370377 queryResult ,
371378 this . isInsights ,
372379 connVersion ,
380+ this . isPython ,
373381 ) ;
374382 }
375383 if ( gridOptions ) {
You can’t perform that action at this time.
0 commit comments