-
Notifications
You must be signed in to change notification settings - Fork 41
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
Handle nested query parameters in Client.attempt #559
Conversation
@@ -154,7 +154,7 @@ func skipf(t *testing.T) func(format string, args ...any) { | |||
// detects if test is run from "debug test" feature in VSCode | |||
func isInDebug() bool { | |||
ex, _ := os.Executable() | |||
return path.Base(ex) == "__debug_bin" | |||
return strings.HasPrefix(path.Base(ex), "__debug_bin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small bugfix to support newest version of Delve (see databricks/terraform-provider-databricks#2497)
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #559 +/- ##
==========================================
+ Coverage 18.62% 18.73% +0.10%
==========================================
Files 85 85
Lines 9373 9388 +15
==========================================
+ Hits 1746 1759 +13
- Misses 7476 7477 +1
- Partials 151 152 +1
☔ View full report in Codecov by Sentry. |
Changes
The Query History list API filter_by query parameter is modeled by a dictionary, rather than a primitive type, defining the allowed filters including query_start_time_range, statuses, user_ids, and warehouse_ids. To be compatible with gRPC transcoding, query parameters modeled by message types as opposed to primitives need to be separated into one query parameter per nested field, where the key is the path to that query parameter. For example:
becomes
go-querystring already flattens this but to a different form:
To fix this, we replace
[
with.
and]
with empty string.This resolves one of the problems from databricks/databricks-sdk-py#99. The issue with the conflict between filter_by and next_page_token will be resolved by the backend service.
Separately, there is an underlying issue affecting the Go SDK specifically, as we delegate query parameter serialization to the go-querystring library. This library looks at the
url
struct tag to name the query parameters appropriately. However, schemas defined inComponents
in OpenAPI are initially cached with IsQuery for all fields = false. As we parse operations, we incrementally discover which entities are present in query parameters, and we need to update the underlying types recursively.Lastly, this includes a bugfix to support the newest version of Delve.
Tests
Added an integration test for ListQueryHistory.
make test
passingmake fmt
applied