From 5aeeaec76d3573028d06e4cea7338e59af4b99af Mon Sep 17 00:00:00 2001 From: Jason Fine Date: Wed, 17 May 2023 13:27:22 +0300 Subject: [PATCH] Scalar queries: Fixed the value being returned inside a json object (#13) * Scalar queries: Fixed the value being returned inside a json object * v0.1.9 --------- Co-authored-by: Robert Navado <837482+navado@users.noreply.github.com> --- pyproject.toml | 2 +- upsolver/client/poller.py | 2 +- upsolver/dbapi/utils.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4390d8c..ff5bfdf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "upsolver-sdk-python" -version = "0.1.8" +version = "0.1.9" description = "Python SDK for Upsolver" authors = ["Upsolver Team "] diff --git a/upsolver/client/poller.py b/upsolver/client/poller.py index dd7e57d..51b328a 100644 --- a/upsolver/client/poller.py +++ b/upsolver/client/poller.py @@ -95,7 +95,7 @@ def extract_json() -> dict: if rjson['kind'] == 'upsolver_scalar_query_response': scalar = result['scalar'] column_name = [scalar['valueType']] - data_w_columns: ExecutionResult = [dict(zip([column_name], [scalar]))] + data_w_columns: ExecutionResult = [dict(zip([column_name], [scalar['value']]))] else: grid = result['grid'] # columns, data, ... column_name = [c['name'] for c in grid['columns']] diff --git a/upsolver/dbapi/utils.py b/upsolver/dbapi/utils.py index 4ce8f5b..0691cde 100644 --- a/upsolver/dbapi/utils.py +++ b/upsolver/dbapi/utils.py @@ -86,7 +86,7 @@ def extract_json() -> dict: if rjson['kind'] == 'upsolver_scalar_query_response': scalar = result['scalar'] columns = [{'name': scalar['valueType'], 'columnType': {'clazz': 'StringColumnType'}}] - return {'columns': columns, 'data': [scalar]}, result.get('next') + return {'columns': columns, 'data': [scalar['value']]}, result.get('next') else: result['grid']['has_next_page'] = result.get('next') is not None return result['grid'], result.get('next')