-
Notifications
You must be signed in to change notification settings - Fork 8
Changed timestamp column in DynamoDB table configuration #48
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
Conversation
… time column elsewhere in the codebase.
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- cloud_aws/src/main/scala/ai/chronon/integrations/aws/DynamoDBKVStoreImpl.scala (3 hunks)
🧰 Additional context used
📓 Learnings (2)
📓 Common learnings
Learnt from: piyush-zlai PR: zipline-ai/chronon#33 File: cloud_aws/src/main/scala/ai/chronon/integrations/aws/DynamoDBKVStoreImpl.scala:245-260 Timestamp: 2024-10-08T16:18:45.669Z Learning: In `DynamoDBKVStoreImpl.scala`, refactoring methods like `extractTimedValues` and `extractListValues` to eliminate code duplication is discouraged if it would make the code more convoluted.Learnt from: piyush-zlai PR: zipline-ai/chronon#33 File: cloud_aws/src/main/scala/ai/chronon/integrations/aws/DynamoDBKVStoreImpl.scala:245-260 Timestamp: 2024-10-07T15:49:27.648Z Learning: In `DynamoDBKVStoreImpl.scala`, refactoring methods like `extractTimedValues` and `extractListValues` to eliminate code duplication is discouraged if it would make the code more convoluted.Learnt from: piyush-zlai PR: zipline-ai/chronon#33 File: cloud_aws/src/test/scala/ai/chronon/integrations/aws/DynamoDBKVStoreTest.scala:175-175 Timestamp: 2024-10-08T16:18:45.669Z Learning: Hardcoding future timestamps in tests within `DynamoDBKVStoreTest.scala` is acceptable when data is generated and queried within the same time range, ensuring the tests remain valid over time.Learnt from: piyush-zlai PR: zipline-ai/chronon#33 File: cloud_aws/src/test/scala/ai/chronon/integrations/aws/DynamoDBKVStoreTest.scala:175-175 Timestamp: 2024-10-07T15:09:51.567Z Learning: Hardcoding future timestamps in tests within `DynamoDBKVStoreTest.scala` is acceptable when data is generated and queried within the same time range, ensuring the tests remain valid over time.cloud_aws/src/main/scala/ai/chronon/integrations/aws/DynamoDBKVStoreImpl.scala (4)
Learnt from: piyush-zlai PR: zipline-ai/chronon#33 File: cloud_aws/src/main/scala/ai/chronon/integrations/aws/DynamoDBKVStoreImpl.scala:245-260 Timestamp: 2024-10-08T16:18:45.669Z Learning: In `DynamoDBKVStoreImpl.scala`, refactoring methods like `extractTimedValues` and `extractListValues` to eliminate code duplication is discouraged if it would make the code more convoluted.Learnt from: piyush-zlai PR: zipline-ai/chronon#33 File: cloud_aws/src/main/scala/ai/chronon/integrations/aws/DynamoDBKVStoreImpl.scala:245-260 Timestamp: 2024-10-07T15:49:27.648Z Learning: In `DynamoDBKVStoreImpl.scala`, refactoring methods like `extractTimedValues` and `extractListValues` to eliminate code duplication is discouraged if it would make the code more convoluted.Learnt from: piyush-zlai PR: zipline-ai/chronon#33 File: cloud_aws/src/test/scala/ai/chronon/integrations/aws/DynamoDBKVStoreTest.scala:175-175 Timestamp: 2024-10-08T16:18:45.669Z Learning: Hardcoding future timestamps in tests within `DynamoDBKVStoreTest.scala` is acceptable when data is generated and queried within the same time range, ensuring the tests remain valid over time.Learnt from: piyush-zlai PR: zipline-ai/chronon#33 File: cloud_aws/src/test/scala/ai/chronon/integrations/aws/DynamoDBKVStoreTest.scala:175-175 Timestamp: 2024-10-07T15:09:51.567Z Learning: Hardcoding future timestamps in tests within `DynamoDBKVStoreTest.scala` is acceptable when data is generated and queried within the same time range, ensuring the tests remain valid over time.
🔇 Additional comments (2)
cloud_aws/src/main/scala/ai/chronon/integrations/aws/DynamoDBKVStoreImpl.scala (2)
Line range hint
1-365: Address checklist items and verify changes before mergingWhile the main change to
sortKeyColumnaligns with the PR objectives and improves code consistency, there are a few items that need attention before this PR can be merged:
- Fix the unintended modification in the
keySchemaconstruction (as mentioned in the previous comment).- Complete the checklist items mentioned in the PR description:
- Add unit tests to cover the changes
- Confirm that the changes are covered by existing CI processes
- Perform integration testing
- Update the documentation to reflect the changes
Additionally, please ensure that the impact of changing
sortKeyColumntoConstants.TimeColumnhas been thoroughly tested and verified across the codebase.To help with the verification process, you can run the following script to check for any tests or documentation that might need updating:
#!/bin/bash # Description: Check for tests and documentation that might need updating # Search for test files related to DynamoDBKVStore echo "Test files that might need updating:" fd -e scala test.*DynamoDBKVStore # Search for documentation files that might mention the timestamp column echo "\nDocumentation files that might need updating:" rg --type md "timestamp.*column" --files-with-matches
57-57: Approved: Improved consistency by using Constants.TimeColumnThis change aligns with the PR objective of modifying the timestamp column and improves code consistency by using a constant instead of a hardcoded string.
To ensure this change doesn't introduce any unintended side effects, please run the following script to verify the usage of
sortKeyColumnacross the codebase:✅ Verification successful
Verified:
sortKeyColumnusage updated correctlyAll usages of
sortKeyColumnhave been successfully updated to useConstants.TimeColumn, and no hardcoded "timestamp" strings remain in the source or test code. The occurrences of "timestamp" in documentation files are expected and do not impact the codebase's functionality.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of sortKeyColumn across the codebase # Search for usages of sortKeyColumn echo "Usages of sortKeyColumn:" rg --type scala "sortKeyColumn" # Search for any remaining hardcoded "timestamp" strings that might need updating echo "\nPotential hardcoded 'timestamp' strings that might need updating:" rg --type scala '"timestamp"'Length of output: 281
Script:
#!/bin/bash # Description: Comprehensive search for sortKeyColumn usage and hardcoded "timestamp" strings across all relevant files # Search for usages of sortKeyColumn in Scala files echo "Usages of sortKeyColumn in Scala files:" rg --type scala "sortKeyColumn" # Search for any remaining hardcoded "timestamp" strings in Scala, test, and documentation files echo "\nPotential hardcoded 'timestamp' strings that might need updating:" rg --type 'scala|test|md' '"timestamp"'Length of output: 1360
Script:
#!/bin/bash # Description: Comprehensive search for sortKeyColumn usage and hardcoded "timestamp" strings across all relevant files # Search for usages of sortKeyColumn in Scala files echo "Usages of sortKeyColumn in Scala files:" rg --type scala "sortKeyColumn" # Search for any remaining hardcoded "timestamp" strings in Scala, Test, and Markdown files echo "\nPotential hardcoded 'timestamp' strings that might need updating:" rg --type scala --type test --type md '"timestamp"'Length of output: 1363
Script:
#!/bin/bash # Description: Comprehensive search for sortKeyColumn usage and hardcoded "timestamp" strings across all relevant files # Search for usages of sortKeyColumn in Scala files echo "Usages of sortKeyColumn in Scala files:" rg --type scala "sortKeyColumn" # Search for any remaining hardcoded "timestamp" strings in Scala test files and Markdown documentation echo "\nPotential hardcoded 'timestamp' strings that might need updating in test and documentation files:" # Search within src/test/scala and all .md files rg "timestamp" src/test/scala --type scala rg "timestamp" --type mdLength of output: 14818
| CreateTableRequest.builder | ||
| .attributeDefinitions(keyAttributes.toList.asJava) | ||
| .keySchema(keySchema.toList.asJava) | ||
| .keySchema(keySchema.toList.asJava)"keyBytes" |
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.
Remove unintended string literal in keySchema construction
There's an unexpected string literal "keyBytes" added to the keySchema construction. This appears to be unintentional and could cause compilation errors or runtime issues.
Please remove the string literal as follows:
- .keySchema(keySchema.toList.asJava)"keyBytes"
+ .keySchema(keySchema.toList.asJava)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .keySchema(keySchema.toList.asJava)"keyBytes" | |
| .keySchema(keySchema.toList.asJava) |
... to match the time column elsewhere in the codebase. ## Summary ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated the sort key definition for DynamoDB tables to use a dynamic constant, improving flexibility and maintainability. - **Bug Fixes** - Minor adjustment made in the key schema construction to enhance code clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Chewy Shaw <[email protected]>
... to match the time column elsewhere in the codebase. ## Summary ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated the sort key definition for DynamoDB tables to use a dynamic constant, improving flexibility and maintainability. - **Bug Fixes** - Minor adjustment made in the key schema construction to enhance code clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Chewy Shaw <[email protected]>
... to match the time column elsewhere in the codebase. ## Summary ## Checklist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated the sort key definition for DynamoDB tables to use a dynamic constant, improving flexibility and maintainability. - **Bug Fixes** - Minor adjustment made in the key schema construction to enhance code clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Chewy Shaw <[email protected]>
... to match the time column elsewhere in the codebase. ## Summary ## Cheour clientslist - [ ] Added Unit Tests - [ ] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated the sort key definition for DynamoDB tables to use a dynamic constant, improving flexibility and maintainability. - **Bug Fixes** - Minor adjustment made in the key schema construction to enhance code clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Chewy Shaw <[email protected]>
... to match the time column elsewhere in the codebase.
Summary
Checklist
Summary by CodeRabbit
New Features
Bug Fixes