-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add filter to next page token so it applies to subsequently requested pages #1153
Conversation
@@ -290,6 +290,7 @@ func (o *Options) nextPageToken(listable Listable) (*token, error) { | |||
KeyFieldName: listable.PrimaryKeyColumnName(), | |||
KeyFieldValue: keyField.Interface(), | |||
IsDesc: o.IsDesc, | |||
Filter: o.Filter, |
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.
can we verify the token can be correctly marshalled into expected string?
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.
Great catch @IronPan ! This was completely missing from before. Best part is, we had a test that would have caught it in experiment_store_test.go, but somehow, it too was testing the wrong value! Fixed this and added tests for serialization/deserialization of token and filter. PTAL.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: IronPan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1 similar comment
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: IronPan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
eq: map[string]interface{}{"name": "SomeName"}, | ||
} | ||
|
||
want := `{"FilterProto":"{\"predicates\":[{\"op\":\"EQUALS\",\"key\":\"Name\",\"stringValue\":\"SomeName\"}]}","EQ":{"name":"SomeName"},"NEQ":null,"GT":null,"GTE":null,"LT":null,"LTE":null,"IN":null,"SUBSTRING":null}` |
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.
is it possible we omit the null?
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.
It is, if we add annotation to the struct. Since this is an internal struct, and explicit is better then implicit for debugging purposes, I left it as is. What do you think?
Fixes #1149
/assign @IronPan
This change is