-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(stepfunctions-tasks): Athena StartQueryExecution includes QueryExecutionContext even when object is empty #16141
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for cleaning up our logic! A couple of further modifications to make things sleek
packages/@aws-cdk/aws-stepfunctions-tasks/lib/athena/start-query-execution.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/athena/start-query-execution.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/athena/start-query-execution.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/athena/start-query-execution.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/athena/start-query-execution.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/athena/start-query-execution.test.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/athena/start-query-execution.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Ben Chaimberg <youppi3@gmail.com>
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, looks great! just some minor stuff
packages/@aws-cdk/aws-stepfunctions-tasks/lib/athena/start-query-execution.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/athena/start-query-execution.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/athena/start-query-execution.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/athena/start-query-execution.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/test/athena/integ.start-query-execution.ts
Outdated
Show resolved
Hide resolved
Pull request has been modified.
packages/@aws-cdk/aws-stepfunctions-tasks/test/athena/start-query-execution.test.ts
Outdated
Show resolved
Hide resolved
Pull request has been modified.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…ecutionContext even when object is empty (aws#16141) fixes: aws#16133 As described in aws#16133, the empty `QueryExecutionContext`, which was included before this fix, leads to an error. To mitigate this, I implemented a check to exclude the `QueryExecutionContext`when both params are empty. This way, it behaves like a truly optional parameter. Additionally I integrated an easier way to merge an OutputLocation if provided. This means less redundancy than the original solution, which returned an object that was only different in one key in each branch. The unittest is based on the default unittest, but a bit "stripped down". It proofs that no empty `QueryExecutionContext` object is present. In my tests, this fixes the ``` { "resourceType": "athena", "resource": "startQueryExecution.sync", "error": "Athena.InvalidRequestException", "cause": "Both queryExecutionContext.catalog and queryExecutionContext.database are null or empty (Service: AmazonAthena; Status Code: 400; Error Code: InvalidRequestException; Request ID: [Censored]; Proxy: null)" } ``` error. This solution turned out to be a bit different than I envisioned in the issue. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…ecutionContext even when object is empty (aws#16141) fixes: aws#16133 As described in aws#16133, the empty `QueryExecutionContext`, which was included before this fix, leads to an error. To mitigate this, I implemented a check to exclude the `QueryExecutionContext`when both params are empty. This way, it behaves like a truly optional parameter. Additionally I integrated an easier way to merge an OutputLocation if provided. This means less redundancy than the original solution, which returned an object that was only different in one key in each branch. The unittest is based on the default unittest, but a bit "stripped down". It proofs that no empty `QueryExecutionContext` object is present. In my tests, this fixes the ``` { "resourceType": "athena", "resource": "startQueryExecution.sync", "error": "Athena.InvalidRequestException", "cause": "Both queryExecutionContext.catalog and queryExecutionContext.database are null or empty (Service: AmazonAthena; Status Code: 400; Error Code: InvalidRequestException; Request ID: [Censored]; Proxy: null)" } ``` error. This solution turned out to be a bit different than I envisioned in the issue. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
fixes: #16133
As described in #16133, the empty
QueryExecutionContext
, which was included before this fix, leads to an error.To mitigate this, I implemented a check to exclude the
QueryExecutionContext
when both params are empty.This way, it behaves like a truly optional parameter.
Additionally I integrated an easier way to merge an OutputLocation if provided.
This means less redundancy than the original solution, which returned an object that was only different in one key in each branch.
The unittest is based on the default unittest, but a bit "stripped down". It proofs that no empty
QueryExecutionContext
object is present.In my tests, this fixes the
error.
This solution turned out to be a bit different than I envisioned in the issue.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license