Skip to content

Commit

Permalink
SnapshotRetention::Tag max_ref_age_ms should be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
c-thiel committed Jun 7, 2024
1 parent 48fa7fe commit 199094e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion crates/iceberg/src/catalog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,9 @@ mod tests {
ref_name: "hank".to_string(),
reference: SnapshotReference {
snapshot_id: 1,
retention: SnapshotRetention::Tag { max_ref_age_ms: 1 },
retention: SnapshotRetention::Tag {
max_ref_age_ms: Some(1),
},
},
};

Expand Down
3 changes: 2 additions & 1 deletion crates/iceberg/src/spec/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ pub enum SnapshotRetention {
Tag {
/// For snapshot references except the main branch, a positive number for the max age of the snapshot reference to keep while expiring snapshots.
/// Defaults to table property history.expire.max-ref-age-ms. The main branch never expires.
max_ref_age_ms: i64,
#[serde(skip_serializing_if = "Option::is_none")]
max_ref_age_ms: Option<i64>,
},
}

Expand Down

0 comments on commit 199094e

Please sign in to comment.