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

s3v2 seems to ignore input cfgs, using just defaults #43

Open
shlomi-dr opened this issue Jan 9, 2022 · 3 comments
Open

s3v2 seems to ignore input cfgs, using just defaults #43

shlomi-dr opened this issue Jan 9, 2022 · 3 comments

Comments

@shlomi-dr
Copy link

Trying to use the new s3v2 apis, I started getting error messages that "I did not specify regions", though I did. Debugging lead me to the following, where the cfgs defined on line 71 are silently ignored by the body:

func NewS3FileWriter(
ctx context.Context,
bucket string,
key string,
uploaderOptions []func(*manager.Uploader),
cfgs ...*aws.Config,
) (source.ParquetFile, error) {
return NewS3FileWriterWithClient(
ctx,
s3.NewFromConfig(getConfig()),
bucket,
key,
uploaderOptions,
)
}

Am I doing something wrong?

@shlomi-dr
Copy link
Author

Worked around this by using NewS3FileWriterWithClient directly.

Really confused why NewS3FileWriter has such misleading signature..

@sjtower
Copy link

sjtower commented Jan 29, 2022

The same problem exists for func NewS3FileReader:

// NewS3FileReader creates an S3 FileReader, to be used with NewParquetReader
func NewS3FileReader(ctx context.Context, bucket string, key string, cfgs ...*aws.Config) (source.ParquetFile, error) {
	return NewS3FileReaderWithClient(ctx, s3.NewFromConfig(getConfig()), bucket, key)
}

the input parameter cfgs is not used. Shouldn't there only be one configuration passed?

EG:

// NewS3FileReader creates an S3 FileReader, to be used with NewParquetReader
func NewS3FileReader(ctx context.Context, bucket string, key string, cfg aws.Config) (source.ParquetFile, error) {
	return NewS3FileReaderWithClient(ctx, s3.NewFromConfig(cfg), bucket, key)
}

@shlomi-dr
Copy link
Author

Yeah, don't know why these functions take n cfgs, and use 0 🤷‍♂️

For now I just work with the *WithClient functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants