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

update go sdk sort of #4733

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/data_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func (d *DataClient) TabularDataBySQL(ctx context.Context, organizationID, sqlQu

// TabularDataByMQL queries tabular data with MQL (MongoDB Query Language) queries.
func (d *DataClient) TabularDataByMQL(
ctx context.Context, organizationID string, query []map[string]interface{},
ctx context.Context, organizationID string, query []map[string]interface{}, useRecentData bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is only a draft, but just surfacing that I expect this to be a breaking change. But I don't have any context on whether this was already agreed upon or if other options are being weighed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I didn't talk to sdk at all about this yet, good point tho. I think there might be a way to make this optional but we're not near that point yet. I made this draft just to test things on the read side with it.

) ([]map[string]interface{}, error) {
mqlBinary := [][]byte{}
for _, q := range query {
Expand All @@ -452,6 +452,7 @@ func (d *DataClient) TabularDataByMQL(
resp, err := d.dataClient.TabularDataByMQL(ctx, &pb.TabularDataByMQLRequest{
OrganizationId: organizationID,
MqlBinary: mqlBinary,
UseRecentData: &useRecentData,
})
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion app/data_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func TestDataClient(t *testing.T) {
RawData: expectedRawDataPb,
}, nil
}
response, err := client.TabularDataByMQL(context.Background(), organizationID, mqlQueries)
response, err := client.TabularDataByMQL(context.Background(), organizationID, mqlQueries, false)
test.That(t, err, test.ShouldBeNil)
test.That(t, response, test.ShouldResemble, rawData)
})
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ require (
go.uber.org/atomic v1.11.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
go.viam.com/api v0.1.380
go.viam.com/api v0.1.381
go.viam.com/test v1.2.4
go.viam.com/utils v0.1.123
goji.io v2.0.2+incompatible
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,8 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go.viam.com/api v0.1.380 h1:VgRHDlPBku+kjIp4omxmPNmRVZezytFUUOFJ2xpRFR8=
go.viam.com/api v0.1.380/go.mod h1:g5eipXHNm0rQmW7DWya6avKcmzoypLmxnMlAaIsE5Ls=
go.viam.com/api v0.1.381 h1:wwaRb3w6CFOWuW4eSZyIswlVBPWFlRX7yrtIV5Rg+zg=
go.viam.com/api v0.1.381/go.mod h1:g5eipXHNm0rQmW7DWya6avKcmzoypLmxnMlAaIsE5Ls=
go.viam.com/test v1.2.4 h1:JYgZhsuGAQ8sL9jWkziAXN9VJJiKbjoi9BsO33TW3ug=
go.viam.com/test v1.2.4/go.mod h1:zI2xzosHdqXAJ/kFqcN+OIF78kQuTV2nIhGZ8EzvaJI=
go.viam.com/utils v0.1.123 h1:0nxG3Rp9MmFn+qFbPQ4qSptz+hvm9MENbPXvKUBgRqU=
Expand Down
Loading