Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct query exception details and fixes for "Script As" requests #514

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

mmcfarland
Copy link
Member

Fixes two issues introduced by recent refactoring:

Batch queries that raised an exception while executing were masking the initial db exception and throwing a custom error, which was displayed to the user. This has been resolved to allow the original db error to be displayed by updating the expected types for resultSetSummaries.

Scripting requests were not having their parameters correctly deserialized and as a result, object property accessors were being called on a dict. The ObjectMetadata attribute type for scripting_object originally had a hacky deserialization workaround because the client/server contracts were misaligned for making a script request. When that was removed for typing fixes, the
parameter was no longer getting deserialized into the correct type, and was left a dict.

I also removed some debugpy configuration that was preventing attaching to the process for breakpoint debugging.

Prior to changes applying stricter type checking, batch query execution
was allowed to return None for result set summaries to the client. That
case was accidently prevented and threw a ValueError, which prevented
the actual DB error from being included in the response to the client. A
test was added to ensure this behavior is restored and remains.
The extra configuration to debugpy was preventing attaching to the
process for breakpoint debugging.
The ObjectMetadata attribute type for scripting object originally had a
hacky workaround because the client/server contracts were misaligned for
making a script request. When that was removed for typing fixes, the
parameter was no longer getting deserialized into the correct type.

Rather than fix the workaround, the contracts were sorted out, with
correct typing, and now the common deserialization code works correctly.
This also requires a change on the vscode client side to align.
@mmcfarland mmcfarland requested review from a team as code owners February 21, 2025 16:57
@mmcfarland mmcfarland merged commit 7961bfe into main Feb 21, 2025
2 checks passed
@mmcfarland mmcfarland deleted the user/mjm/fix-query-no-results branch February 21, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants