Description
Feature Request / Improvement
While thinking about #1971 and #1972, I realised that V3 introduces new fields to Snapshot
- one required for V3 and the other not.
As it stands, it feels inelegant to add the V3 required field as an optional field on the Snapshot
class and e.g. check within TableMetadata
construction that it's present if the table is V3 (or just not do this at all). I think it might be nicer to encode that information within the typing (model), similar to the TableMetadataV3
excerpt below.
iceberg-python/pyiceberg/table/metadata.py
Lines 552 to 560 in 201057e
I'm therefore wondering about about "versioning" Snapshot
similar to TableMetadata
, so that V3 TableMetadata
would contain a list of V3 Snapshot
s. Then, if V3 snapshot fields are present in V2 metadata, we'd get the benefit of throwing which I think is nice about PyIceberg's TableMetadata
Union
setup here compared to other implementations.
(I've not fleshed out the details here so not certain this is feasible but dropping an issue for now. Perhaps this has already been discussed / thought about 😄)