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

feat: Add support for retrieving DateTime attributes in UTC timezone from a DynamoDB table #3098

Merged
merged 3 commits into from
Nov 16, 2023

Conversation

96malhar
Copy link
Contributor

@96malhar 96malhar commented Nov 10, 2023

Description

This PR adds support for retrieving DateTime attributes in UTC timezone from a DynamoDB table.

While working in the data model mode, this PR introduces a boolean flag called RetrieveDateTimeInUtc as part of the DynamoDBContextConfig as well as the global AWSConfigsDynamoDB.Context. If set to true, then all DateTime attributes are retrieved in the UTC timezone.

While working in the document model mode, Each Document object stores attributes as a DynamoDBEntry. The SDK already has the AsDateTime virtual method that is used to convert a DynamoDBEntry to a DateTime object. This PR also introduces a AsDateTimeUtc method to retrieve all DateTime attributes in the UTC timezone.

Motivation and Context

Fixes #1450 and DOTNET-7259

Testing

Added new unit and integration tests.
Successful dry-run (build-id: 39a8ce27-a0db-4976-8ee4-5bd6f6a41004 and 693449ba-8bf6-4280-bf21-fc8ec0bdf2d3)

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@96malhar 96malhar requested review from ashovlin and normj November 16, 2023 06:13
@96malhar 96malhar force-pushed the kmalhar/ddb-timezone branch from 4971c70 to d3762f6 Compare November 16, 2023 06:17
@96malhar 96malhar merged commit b86f2ac into main-staging Nov 16, 2023
@dscpinheiro dscpinheiro deleted the kmalhar/ddb-timezone branch November 27, 2023 13:15
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