(functionName: string, result: any)
| 141 | } |
| 142 | |
| 143 | function validateClassificationResult(functionName: string, result: any): void { |
| 144 | if ( |
| 145 | !hasPythonResultProperty(result, 'classification') && |
| 146 | !hasPythonResultProperty(result, 'error') |
| 147 | ) { |
| 148 | throw new Error( |
| 149 | `The Python script \`${functionName}\` function must return a dict with an own \`classification\` object or \`error\` string (inherited prototype properties are rejected), instead of ${JSON.stringify( |
| 150 | result, |
| 151 | )}`, |
| 152 | ); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | function validatePythonScriptResult( |
| 157 | apiType: PythonApiType, |
no test coverage detected
searching dependent graphs…