Skip to content

Conversation

giograno
Copy link
Member

@giograno giograno commented Dec 31, 2024

Motivation

We got a report from a customer mentioning that an empty parameter list in an execute statement command does not raise any error against LocalStack when using the JS client.

For instance, the following snippet would raise a ValidationException error against AWS, but not against LocalStack.

const params = {
  Statement: "SELECT * FROM Table", 
  Parameters: []
};
const command = new ExecuteStatementCommand(params);
await client.send(command)

Changes

  • Adding a check for an empty parameter list;
  • Adding a snapshot test.

@giograno giograno added aws:dynamodb Amazon DynamoDB semver: patch Non-breaking changes which can be included in patch releases labels Dec 31, 2024
Copy link

github-actions bot commented Dec 31, 2024

LocalStack Community integration with Pro

    2 files  ±    0      2 suites  ±0   30m 36s ⏱️ - 1h 22m 45s
1 065 tests  - 2 839  1 008 ✅  - 2 589  57 💤  - 250  0 ❌ ±0 
1 067 runs   - 2 839  1 008 ✅  - 2 589  59 💤  - 250  0 ❌ ±0 

Results for commit 43743b8. ± Comparison against base commit 5399278.

This pull request removes 2840 and adds 1 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.aws.services.dynamodb.test_dynamodb.TestDynamoDB ‑ test_dynamodb_execute_statement_empy_parameter

♻️ This comment has been updated with latest results.

@giograno giograno changed the title DDB: parity fix with for JS client DDB: parity fix for JS clients Dec 31, 2024
@giograno giograno marked this pull request as ready for review December 31, 2024 08:50
Copy link
Member

@viren-nadkarni viren-nadkarni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look great. I think this will need to be ported to DDB v2 provider too, did you run any checks there?

@giograno
Copy link
Member Author

giograno commented Jan 3, 2025

The changes look great. I think this will need to be ported to DDB v2 provider too, did you run any checks there?

The behavior was the same. I ported the fix over 👍

Copy link
Member

@viren-nadkarni viren-nadkarni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this @giograno !

@giograno giograno merged commit f94b900 into master Jan 3, 2025
31 checks passed
@giograno giograno deleted the js-parity-ddb branch January 3, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:dynamodb Amazon DynamoDB semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants