ML extension - Improving predict parameter mapping experience (#10264)

This commit is contained in:
Leila Lali
2020-05-10 18:10:17 -07:00
committed by GitHub
parent f6e7b56946
commit 3d2d791f18
44 changed files with 782 additions and 388 deletions

View File

@@ -61,12 +61,19 @@ export class DeployedModelService {
*/
public async downloadModel(model: ImportedModel): Promise<string> {
let connection = await this.getCurrentConnection();
let fileContent: string = '';
if (connection) {
const query = queries.getModelContentQuery(model);
let result = await this._queryRunner.safeRunQuery(connection, query);
if (result && result.rows && result.rows.length > 0) {
const content = result.rows[0][0].displayValue;
return await utils.writeFileFromHex(content);
for (let index = 0; index < result.rows[0].length; index++) {
const column = result.rows[0][index];
let content = column.displayValue;
content = content.startsWith('0x') || content.startsWith('0X') ? content.substr(2) : content;
fileContent = fileContent + content;
}
return await utils.writeFileFromHex(fileContent);
} else {
throw Error(constants.invalidModelToSelectError);
}
@@ -170,6 +177,13 @@ export class DeployedModelService {
}
}
/**
* Installs the dependencies required for model management
*/
public async installDependencies(): Promise<void> {
await this._modelClient.installDependencies();
}
public async getRecentImportTable(): Promise<DatabaseTable> {
let connection = await this.getCurrentConnection();
let table: DatabaseTable | undefined;
@@ -209,6 +223,7 @@ export class DeployedModelService {
deploymentTime: row[7].displayValue,
deployedBy: row[8].displayValue,
runId: row[9].displayValue,
contentLength: +row[10].displayValue,
table: table
};
}