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

Update deleteItem Function to Use Client-Configured DynamoDB Table Name #9

Closed
thusharprakash opened this issue Dec 26, 2023 · 0 comments

Comments

@thusharprakash
Copy link
Contributor

Description:

Issue:
The current implementation of the deleteItem function relies on fetching the table name from the DYNAMODB_TABLE environment variable. This approach necessitates the maintenance of a separate variable (DYNAMODB_TABLE) for the function to operate correctly. This deviation from the standard configuration used across other functions introduces complexity and potential inconsistencies in the codebase.

Proposed Solution:
Modify the deleteItem function to utilize the table name configured for the DynamoDB client, aligning it with the established pattern used by other functions. This adjustment aims to improve code consistency, eliminate the need for an extra environment variable, and ensure a streamlined approach to handling DynamoDB table names.

Steps to Resolve:

Review the existing implementation of the deleteItem function.
Identify the section where the table name is fetched from the DYNAMODB_TABLE environment variable.
Update the function to use the table name configured for the DynamoDB client, consistent with other functions.
Ensure that unit tests are updated to reflect the changes and validate the correct functioning of the modified deleteItem function.
Perform manual testing to verify that the function operates as expected in various scenarios.
Expected Outcomes:

Improved code consistency by aligning the deleteItem function with the configuration pattern used by other functions.
Elimination of the need for a separate environment variable (DYNAMODB_TABLE) specific to the deleteItem function.

github-merge-queue bot pushed a commit that referenced this issue Jan 4, 2024
## Description:

### Changes Made:
The deleteItem function is currently relying on the table name fetched
from the environment variable. This requires the maintenance of a
separate variable named DYNAMODB_TABLE for the function to operate
correctly. To align with the consistency of the codebase and ensure
uniformity, I have made modifications to the function. The updated
implementation now utilizes the table name configured for the DynamoDB
client, bringing it in line with the approach adopted by other
functions. This adjustment addresses an oversight where the deleteItem
function was not following the same convention as other functions in
handling the DynamoDB table name.

Key Points:

### Before:

deleteItem function used the table name from the DYNAMODB_TABLE
environment variable.
Required a separate variable (DYNAMODB_TABLE) for correct functionality.
### After:

Modified deleteItem to use the table name configured for the DynamoDB
client.
Ensures consistency with other functions in the codebase.
Reason for the Change:
To maintain code consistency and streamline the usage of DynamoDB table
names across functions. This change eliminates the need for a separate
environment variable (DYNAMODB_TABLE) specific to the deleteItem
function, aligning it with the established configuration pattern used by
other functions.

## Related Issues:
#9
@shidil shidil closed this as completed Aug 10, 2024
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