Skip to content

Commit

Permalink
fix(warehouse|bigquery): read operation - response missing dataCollector
Browse files Browse the repository at this point in the history
  • Loading branch information
ndopj committed Oct 4, 2023
1 parent 8ab77d6 commit 3cea0d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion monte_carlo/resources/bigquery_warehouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (r *BigQueryWarehouseResource) Read(ctx context.Context, req resource.ReadR

getResult := client.GetWarehouse{}
variables := map[string]interface{}{"uuid": client.UUID(data.Uuid.ValueString())}
query := "query getWarehouse($uuid: UUID) { getWarehouse(uuid: $uuid) { name,connections{uuid,type} } }"
query := "query getWarehouse($uuid: UUID) { getWarehouse(uuid: $uuid) { name,connections{uuid,type},dataCollector{uuid} } }"

if bytes, err := r.client.ExecRaw(ctx, query, variables); err != nil && (bytes == nil || len(bytes) == 0) {
toPrint := fmt.Sprintf("MC client 'GetWarehouse' query result - %s", err.Error())
Expand Down
2 changes: 1 addition & 1 deletion monte_carlo/resources/bigquery_warehouse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func initMonteCarloClient() client.MonteCarloClient {
})

// Read operations
readQuery := "query getWarehouse($uuid: UUID) { getWarehouse(uuid: $uuid) { name,connections{uuid,type} } }"
readQuery := "query getWarehouse($uuid: UUID) { getWarehouse(uuid: $uuid) { name,connections{uuid,type},dataCollector{uuid} } }"
readVariables1 := map[string]interface{}{"uuid": client.UUID("8bfc4")}
readResponse1 := []byte(`{"getWarehouse":{"name":"name1","connections":[{"uuid":"8cd5a"}],"dataCollector":{"uuid":"dataCollector1"}}}`)
mcClient.On("ExecRaw", mock.Anything, readQuery, readVariables1).Return(readResponse1, nil)
Expand Down

0 comments on commit 3cea0d0

Please sign in to comment.