Skip to content

Commit 7dc7afe

Browse files
committed
fixing return type for trained functions
1 parent 123f0b7 commit 7dc7afe

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

polyapi/function_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def function_add_or_update(
5151
"description": description or parsed["types"]["description"],
5252
"code": code,
5353
"language": "python",
54-
"returnType": return_type,
54+
"returnType": get_jsonschema_type(return_type),
5555
"returnTypeSchema": parsed["types"]["returns"]["typeSchema"],
5656
"arguments": [{**p, "key": p["name"], "type": get_jsonschema_type(p["type"]) } for p in parsed["types"]["params"]],
5757
"logsEnabled": logs_enabled or parsed["config"].get("logs_enabled", False),

polyapi/sync.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ def sync_function_and_get_id(deployable: SyncDeployment, code: str) -> str:
5050
headers = get_auth_headers(api_key)
5151
url = f'{deployable["instance"]}/functions/{deployable["type"].replace("-function", "")}'
5252
payload = {
53+
**deployable["config"],
5354
"context": deployable["context"],
5455
"name": deployable["name"],
5556
"description": deployable["description"],
5657
"code": code,
5758
"language": "python",
58-
"returnType": deployable["types"]["returns"]["type"],
59+
"returnType": get_jsonschema_type(deployable["types"]["returns"]["type"]),
5960
"returnTypeSchema": deployable["types"]["returns"]["typeSchema"],
60-
**deployable["config"],
6161
"arguments": [{**p, "key": p["name"], "type": get_jsonschema_type(p["type"]) } for p in deployable["types"]["params"]],
6262
}
6363
response = requests.post(url, headers=headers, json=payload)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"]
33

44
[project]
55
name = "polyapi-python"
6-
version = "0.3.1.dev15"
6+
version = "0.3.1.dev16"
77
description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers"
88
authors = [{ name = "Dan Fellin", email = "dan@polyapi.io" }]
99
dependencies = [

0 commit comments

Comments
 (0)