Skip to content

Fix queries without arguments #74

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

Merged
merged 1 commit into from
Jun 1, 2025

Conversation

nathanjcochran
Copy link
Contributor

@nathanjcochran nathanjcochran commented Apr 30, 2025

It seems that #63 introduced a bug that broke queries that aren't using arguments. Any queries without arguments now return the following error:

InvalidParameter: 1 validation error(s) found. - minimum field size of 1, StartQueryExecutionInput.ExecutionParameters.

The problem is that the buildExecutionParams function returns an empty but non-nil slice when no args are provided. That ultimately gets passed as the ExecutionParameters in the call to StartQueryExecution. That in turn causes a validation error in the underlying Athena library, because it validates that the slice has a length of at least 1 if it's non-nil. See the min:"1" type:"list" struct tag on the ExecutionParameters field in the StartQueryExecutionInput struct.

This fixes the issue by returning a nil slice instead of an empty slice if no args are provided.

@CLAassistant
Copy link

CLAassistant commented Apr 30, 2025

CLA assistant check
All committers have signed the CLA.

@henrywoo henrywoo merged commit ed47351 into uber:master Jun 1, 2025
3 checks passed
@nathanjcochran nathanjcochran deleted the nathan/fix-queries-without-args branch June 2, 2025 21:22
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

Successfully merging this pull request may close these issues.

3 participants