rambleraptor commented on code in PR #3457:
URL: https://github.com/apache/iceberg-python/pull/3457#discussion_r3384066310
##########
pyiceberg/table/inspect.py:
##########
@@ -333,6 +424,21 @@ def _update_partitions_map_from_manifest_entry(
partition_record_dict: dict[str, Any],
snapshot: Snapshot | None,
) -> None:
+ """Update the partition statistics map with data from a single
manifest entry.
+
+ Initialises a new partition row if the key has not been seen, then
+ increments count and size statistics based on the file content type.
+
+ Args:
+ partitions_map: Mutable dict keyed by hashable partition values,
+ accumulating per-partition statistics.
+ file: The data file entry from the manifest.
+ partition_record_dict: Maps partition field names to their values.
+ snapshot: The owning snapshot, used to track last-updated
timestamps.
+
+ Raises:
+ ValueError: If the file has an unknown ``DataFileContent`` type.
Review Comment:
It's unlikely to happen, but line 476 makes it very clear that it could
happen. I think it's important for users to be aware of what exceptions could
be thrown.
(This lets users do `try x, except ValueError` instead of the much worse
`try x, except Exception`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]