Skip to content

Commit

Permalink
fix: ensure metaData.createdTime is set to the action creation time
Browse files Browse the repository at this point in the history
Fixes #2925
  • Loading branch information
rtyler committed Oct 7, 2024
1 parent c8b47a0 commit 32a3945
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/core/src/kernel/models/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Metadata {
configuration,
name: None,
description: None,
created_time: None,
created_time: Some(chrono::Utc::now().timestamp_millis()),
})
}

Expand Down
9 changes: 9 additions & 0 deletions crates/core/src/operations/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,15 @@ mod tests {
let names = fields.map(|f| f.name()).collect::<Vec<_>>();
assert_eq!(names, vec!["id", "value", "modified", "inserted_by"]);

// <https://github.com/delta-io/delta-rs/issues/2925>
let metadata = table
.metadata()
.expect("Failed to retrieve updated metadata");
assert_ne!(
None, metadata.created_time,
"Created time should be the milliseconds since epoch of when the action was created"
);

let write_metrics: WriteMetrics = get_write_metrics(table.clone()).await;
assert_common_write_metrics(write_metrics);
}
Expand Down

0 comments on commit 32a3945

Please sign in to comment.