diff --git a/crates/iceberg/src/catalog/mod.rs b/crates/iceberg/src/catalog/mod.rs index 620b7d3e7..f2e740aef 100644 --- a/crates/iceberg/src/catalog/mod.rs +++ b/crates/iceberg/src/catalog/mod.rs @@ -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), + }, }, }; diff --git a/crates/iceberg/src/spec/snapshot.rs b/crates/iceberg/src/spec/snapshot.rs index 53eee6bf6..e0ff0794d 100644 --- a/crates/iceberg/src/spec/snapshot.rs +++ b/crates/iceberg/src/spec/snapshot.rs @@ -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, }, }