Skip to content

Commit 1912f0f

Browse files
authored
SnapshotRetention::Tag max_ref_age_ms should be optional (#391)
1 parent ffafe15 commit 1912f0f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

crates/iceberg/src/catalog/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,9 @@ mod tests {
982982
ref_name: "hank".to_string(),
983983
reference: SnapshotReference {
984984
snapshot_id: 1,
985-
retention: SnapshotRetention::Tag { max_ref_age_ms: 1 },
985+
retention: SnapshotRetention::Tag {
986+
max_ref_age_ms: Some(1),
987+
},
986988
},
987989
};
988990

crates/iceberg/src/spec/snapshot.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ pub enum SnapshotRetention {
351351
Tag {
352352
/// For snapshot references except the main branch, a positive number for the max age of the snapshot reference to keep while expiring snapshots.
353353
/// Defaults to table property history.expire.max-ref-age-ms. The main branch never expires.
354-
max_ref_age_ms: i64,
354+
#[serde(skip_serializing_if = "Option::is_none")]
355+
max_ref_age_ms: Option<i64>,
355356
},
356357
}
357358

0 commit comments

Comments
 (0)