This repository was archived by the owner on Sep 16, 2025. It is now read-only.
Added support for queries that return scalar results#11
Merged
navado merged 2 commits intodevelopUpsolver/upsolver-sdk-python:developfrom May 16, 2023
support-scalar-queriesUpsolver/upsolver-sdk-python:support-scalar-queriesCopy head branch name to clipboard
Merged
Added support for queries that return scalar results#11navado merged 2 commits intodevelopUpsolver/upsolver-sdk-python:developfrom support-scalar-queriesUpsolver/upsolver-sdk-python:support-scalar-queriesCopy head branch name to clipboard
navado merged 2 commits intodevelopUpsolver/upsolver-sdk-python:developfrom
support-scalar-queriesUpsolver/upsolver-sdk-python:support-scalar-queriesCopy head branch name to clipboard
Conversation
navado
previously approved these changes
May 16, 2023
navado
suggested changes
May 16, 2023
Contributor
navado
left a comment
There was a problem hiding this comment.
Can you please add example of this query to examples and test case to DB API tests?
Contributor
Author
|
I didn’t see a way to add a test easily since the test_dbapi.py file doesn’t mock the entire response, it mocks just the grid, so that wouldn’t test anything. Since the change happens in the response parsing which I didn't see an existing spec for. I also don’t think it really is required in the example since it’s just another query from the user’s perspective. In addition there isn't a section about creating jobs right now so there also isn't a good place to add it to in the README. |
A scalar result is returned as:
```
[
{
"status": "Success",
"kind": "upsolver_scalar_query_response",
"result":
{
"scalar":
{
"value": "<value_here>",
"valueType": "<value_type_here>"
}
}
}
]
```
This commit transforms this result into a 1x1 grid with a column name of
`valueType`.
1551a28 to
0732860
Compare
Contributor
Author
|
Added an example how this would be used in the examples.py file |
navado
approved these changes
May 16, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Queries such as
SHOW CREATE JOB <job_name>return scalar results. A scalar result is returned as:This commit transforms this result into a 1x1 grid with a column name of
valueType.