Skip to content

Commit

Permalink
Scalar queries: Fixed the value being returned inside a json object (#13
Browse files Browse the repository at this point in the history
)

* 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>
  • Loading branch information
jasonf20 and navado authored May 17, 2023
1 parent c555cb1 commit 5aeeaec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <info@upsolver.com>"]

Expand Down
2 changes: 1 addition & 1 deletion upsolver/client/poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']]
Expand Down
2 changes: 1 addition & 1 deletion upsolver/dbapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 5aeeaec

Please sign in to comment.