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

[DynamoDB event] Makes ApproximateCreationDateTime optional in StreamRecord #891

Merged
merged 1 commit into from
Jun 6, 2024
Merged

[DynamoDB event] Makes ApproximateCreationDateTime optional in StreamRecord #891

merged 1 commit into from
Jun 6, 2024

Conversation

jfkisafk
Copy link
Contributor

@jfkisafk jfkisafk commented Jun 6, 2024

Issue #, if available: closes #889

Description of changes: Makes the DDB event StreamRecord more robust, b/c it appears that ApproximateCreationDateTime can be absent. The DDB docs are ambiguous in this matter as they suggest it is not required but also say:

In the following list, the required parameters are described first.

Maybe we can get more guidance from DDB team?

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.
  • I confirm that I've run the tests locally using cargo test
  • I confirm that I've run the lint locally using cargo fmt

#[serde(rename = "ApproximateCreationDateTime")]
#[serde(with = "float_unix_epoch")]
#[serde(default)]
pub approximate_creation_date_time: DateTime<Utc>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did not want to change contracts by making this Option<DateTime<Utc>>, but if that makes more sense please let me know.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is a good approach, thanks!

@jfkisafk jfkisafk marked this pull request as ready for review June 6, 2024 09:54
@calavera calavera merged commit d03bbc4 into awslabs:main Jun 6, 2024
5 checks passed
@jfkisafk jfkisafk deleted the events/dynamo branch June 6, 2024 15:31
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.

Error: Records[0].dynamodb: missing field ApproximateCreationDateTime
2 participants