You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings and Happy New Year :3!
I have a question!, How can i register and await async functions?.
I tried something like this:
import jsonata
class JsonataFunctions:
class Asum(jsonata.Jsonata.JFunctionCallable):
async def call(self, inputs, args):
result = await (args[0] + args[1])
return result
def test_async_jsonata():
expression_input = {}
expression_str = """ {"test": $aSum(1, 2)}"""
expression = jsonata.Jsonata(expression_str)
expression.register_function(
"aSum", jsonata.Jsonata.JFunction(JsonataFunctions.Asum(), "<nn:n>"))
return expression.evaluate(expression_input)
But every instance of a function in the expression is replaced with a coroutine and never awaited.
In the example: {'test': <coroutine object JsonataFunctions.Asum.call at 0x117827bc0>}
Maybe im doing something wrong or the library doesn't support it, i hope you can help me!, good work btw :D!
The text was updated successfully, but these errors were encountered:
Greetings and Happy New Year :3!
I have a question!, How can i register and await async functions?.
I tried something like this:
But every instance of a function in the expression is replaced with a coroutine and never awaited.
In the example:
{'test': <coroutine object JsonataFunctions.Asum.call at 0x117827bc0>}
Maybe im doing something wrong or the library doesn't support it, i hope you can help me!, good work btw :D!
The text was updated successfully, but these errors were encountered: