You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue in compilation of any code using the timestreamquery service.
When compiling, it throws a large amount of errors, all seemingly related to the "c.fetchOpListScheduledQueriesDiscoverEndpoint"
Expected Behavior
Compiled without errors. In the code snippet below the aim is to simply query the database and check it has more than one entry
Current Behavior
This error was thrown
❯ go test -v
# github.com/aws/aws-sdk-go-v2/service/timestreamquery
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_CancelQuery.go:150:33: cannot use c.fetchOpCancelQueryDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_CreateScheduledQuery.go:214:33: cannot use c.fetchOpCreateScheduledQueryDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_DeleteScheduledQuery.go:139:33: cannot use c.fetchOpDeleteScheduledQueryDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_DescribeScheduledQuery.go:146:33: cannot use c.fetchOpDescribeScheduledQueryDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_ExecuteScheduledQuery.go:151:33: cannot use c.fetchOpExecuteScheduledQueryDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_ListScheduledQueries.go:152:33: cannot use c.fetchOpListScheduledQueriesDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_ListTagsForResource.go:157:33: cannot use c.fetchOpListTagsForResourceDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_PrepareQuery.go:165:33: cannot use c.fetchOpPrepareQueryDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_Query.go:234:33: cannot use c.fetchOpQueryDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_TagResource.go:148:33: cannot use c.fetchOpTagResourceDiscoverEndpoint (value of type func(ctx "context".Context, optFns ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error)) as func(ctx "context".Context, region string, options ...func(*endpointdiscovery.DiscoverEndpointOptions)) (endpointdiscovery.WeightedAddress, error) value in struct literal
.../go/pkg/mod/github.com/aws/aws-sdk-go-v2/service/[email protected]/api_op_TagResource.go:148:33: too many errors
FAIL my-test[build failed]
Reproduction Steps
run a go test on this and the error will be recreated.
package module_test
import (
"context""fmt""testing""github.com/aws/aws-sdk-go-v2/config""github.com/aws/aws-sdk-go-v2/service/timestreamquery""github.com/aws/aws-sdk-go/aws""github.com/stretchr/testify/require"
)
funcTestModule(t*testing.T) {
// Create AWS Session for testingctx:=context.Background()
cfg, err:=config.LoadDefaultConfig(ctx)
require.Nil(t, err, "Error loading AWS config")
timestreamQueryClient:=timestreamquery.NewFromConfig(cfg, func(o*timestreamquery.Options) {
o.Region="eu-west-1"
})
dbName:="hello-world"tableName:="hello-world"// Assert Data has been written to Timestreamt.Run("CheckTimestreamDataExists", func(t*testing.T) {
CheckTimestreamDataExists(t, ctx, timestreamQueryClient, dbName, tableName)
})
}
// Function to check if data has been written to timestreamfuncCheckTimestreamDataExists(t*testing.T, ctx context.Context, client*timestreamquery.Client, databaseNamestring, tableNamestring) {
output, err:=client.Query(ctx, ×treamquery.QueryInput{
QueryString: aws.String(fmt.Sprintf("SELECT * FROM \"%s\".\"%s\"", databaseName, tableName)),
})
iferr!=nil {
fmt.Println(err.Error())
}
require.Nil(t, err, "Error getting timestream data")
// Assert that more than 0 records have been returnedrequire.Greater(t, len(output.Rows), 0, "No data returned from timestream")
}
Possible Solution
This error has only started happening in the latest version. Therefore when the fix occured for a different bug, this bug was introduced.
Additional Information/Context
This was using a query against a database. I have written a test that queries that data exists in a table for an integration test.
@porrige51122 The signature of an API in the internal package endpoint-discovery was changed in 1.8.8 (from the latest release https://github.com/aws/aws-sdk-go-v2/releases/tag/release-2023-11-30.2) to facilitate the fix of #2163 . Versions of endpoint discovery released before yesterday will no longer be compatible, which includes the timestreamquery v1.19.2 version your example is using.
You'll need to upgrade any dependencies of timestreamwrite, timestreamquery, or dynamodb (these are the only affected services) to the latest versions (1.23.2, 1.20.2, and 1.26.2 respectively).
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
Issue in compilation of any code using the timestreamquery service.
When compiling, it throws a large amount of errors, all seemingly related to the "c.fetchOpListScheduledQueriesDiscoverEndpoint"
Expected Behavior
Compiled without errors. In the code snippet below the aim is to simply query the database and check it has more than one entry
Current Behavior
This error was thrown
Reproduction Steps
run a go test on this and the error will be recreated.
Possible Solution
This error has only started happening in the latest version. Therefore when the fix occured for a different bug, this bug was introduced.
Additional Information/Context
This was using a query against a database. I have written a test that queries that data exists in a table for an integration test.
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.21.4 darwin/arm64
Operating System and version
macOS Ventura 13.5.2
The text was updated successfully, but these errors were encountered: