[Error] Untyped value conversion failed

Dear Members,

Need assistance on one of the issue i’m encountering when trying to implement the below logic.

Flow: Workshop Action → TypeScript function (optimize or wrapper) → Calls Python compute module .

As per palantir, we need to expose the python function to be called in by typescript using.

`` @function(api_name=“space”) # ComputeModule API name

when we use the above api definition and test in compute module, we get “[Error] Untyped value conversion failed: {“error”:“Unknown query type”}” error and without that the test success and returns the result.

At the same time, if we don’t use the apiname in typescript then

a. we are not able to import query function through ResourceImports

b. build fails by throwing npm and graddle errors.

When we use the below definition [ Uses & Queries] then we get ‘unable to determine query parameter’ & ‘Found unexpected value for function return type’.

import { Function, Integer, OntologyEditFunction, Edits, LocalDate, Double, Uses } from “@foundry/functions-api”;

import {optimizeresults, Objects, agg, Queries} from “@foundry/ontology-api”;

export class MyFunctions { @Uses({ queries: [Queries.space] })

@Edits(optimizeresults, agg)

@OntologyEditFunction()

public async optimize(

Error: Getting on python compute module when we use

[Error] Untyped value conversion failed: {"error":"Unknown query type"}

Thanks,

A

Hi @akp , the {“error”: “Unknown query type”} you mention comes from the Compute Modules Python library. That error indicates the function you are attempting to invoke does not exist based on the query_type provided (aka the function name).

Please have a look at https://community.palantir.com/t/how-can-i-import-a-compute-module-backed-function-in-a-normal-typescript-v1-v2-or-python-function/4170 for instructions on how to publish a function from a compute module that can then be imported into a TypeScript Functions repository