Skip to content

Commit 0cc6f14

Browse files
committed
tweaks to runtime
1 parent ccd15c4 commit 0cc6f14

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

extensions/positron-python/python_files/posit/positron/data_explorer.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from .data_explorer_comm import (
2828
ArraySelection,
2929
BackendState,
30-
CodeSyntaxFeatures,
3130
CodeSyntaxName,
3231
ColumnDisplayType,
3332
ColumnFilter,
@@ -48,6 +47,7 @@
4847
ColumnSummaryStats,
4948
ColumnValue,
5049
ConvertedCode,
50+
ConvertToCodeFeatures,
5151
ConvertToCodeRequest,
5252
DataExplorerBackendMessageContent,
5353
DataExplorerFrontendEvent,
@@ -816,9 +816,12 @@ def _prof_histogram(
816816
support_status=SupportStatus.Unsupported,
817817
supported_formats=[],
818818
),
819-
code_syntaxes=CodeSyntaxFeatures(
819+
convert_to_code=ConvertToCodeFeatures(
820820
support_status=SupportStatus.Supported,
821-
code_syntaxes=["pandas", "polars"],
821+
code_syntaxes=[
822+
CodeSyntaxName(code_syntax_name="pandas"),
823+
CodeSyntaxName(code_syntax_name="polars"),
824+
],
822825
),
823826
)
824827

@@ -1937,8 +1940,9 @@ def _prof_histogram(
19371940
ExportFormat.Html,
19381941
],
19391942
),
1940-
code_syntaxes=CodeSyntaxFeatures(
1941-
support_status=SupportStatus.Supported, code_syntaxes=["pandas"]
1943+
convert_to_code=ConvertToCodeFeatures(
1944+
support_status=SupportStatus.Supported,
1945+
code_syntaxes=[CodeSyntaxName(code_syntax_name="pandas")],
19421946
),
19431947
)
19441948

@@ -2801,8 +2805,9 @@ def _prof_histogram(
28012805
supported_formats=[ExportFormat.Csv, ExportFormat.Tsv],
28022806
),
28032807
set_sort_columns=SetSortColumnsFeatures(support_status=SupportStatus.Supported),
2804-
code_syntaxes=CodeSyntaxFeatures(
2805-
support_status=SupportStatus.Supported, code_syntaxes=["polars"]
2808+
convert_to_code=ConvertToCodeFeatures(
2809+
support_status=SupportStatus.Supported,
2810+
code_syntaxes=[CodeSyntaxName(code_syntax_name="polars")],
28062811
),
28072812
)
28082813

extensions/positron-python/python_files/posit/positron/data_explorer_comm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class CodeSyntaxName(BaseModel):
267267
Syntax to use for code conversion
268268
"""
269269

270-
code_syntax_name: CodeSyntaxName = Field(
270+
code_syntax_name: StrictStr = Field(
271271
description="The name of the code syntax, eg, pandas, polars, dplyr, etc.",
272272
)
273273

positron/comms/data_explorer-backend-openrpc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
],
299299
"properties": {
300300
"code_syntax_name": {
301-
"$ref": "#/components/schemas/code_syntax_name",
301+
"type": "string",
302302
"description": "The name of the code syntax, eg, pandas, polars, dplyr, etc."
303303
}
304304
}

src/vs/workbench/services/languageRuntime/common/languageRuntimeDataExplorerClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ export class DataExplorerClientInstance extends Disposable {
570570
private async isSyntaxSupported(syntax: CodeSyntaxName, backendState: BackendState): Promise<void> {
571571
await this.isConvertToCodeSupported(backendState);
572572

573-
if (syntax && !backendState.supported_features.convert_to_code.code_syntaxes?.some(s => s.code_syntax_name === syntax)) {
573+
if (syntax && !backendState.supported_features.convert_to_code.code_syntaxes?.some(s => s === syntax)) {
574574
throw new Error(`Code syntax "${syntax}" is not supported by the backend.`);
575575
}
576576
}

src/vs/workbench/services/languageRuntime/common/positronDataExplorerComm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface CodeSyntaxName {
7272
/**
7373
* The name of the code syntax, eg, pandas, polars, dplyr, etc.
7474
*/
75-
code_syntax_name: CodeSyntaxName;
75+
code_syntax_name: string;
7676

7777
}
7878

0 commit comments

Comments
 (0)