xanderbailey commented on code in PR #4159:
URL: https://github.com/apache/iceberg-python/pull/4159#discussion_r4449899647


##########
pyiceberg/table/__init__.py:
##########
@@ -1340,13 +1342,26 @@ def __init__(
         io: FileIO,
         catalog: Catalog,
         config: dict[str, str] = EMPTY_DICT,
+        kms_client: KeyManagementClient | None = None,
     ) -> None:
         self._identifier = identifier
         self.metadata = metadata
         self.metadata_location = metadata_location
         self.io = io
         self.catalog = catalog
         self.config = config
+        self._kms_client = kms_client
+
+    @property
+    def encryption_manager(self) -> EncryptionManager | None:
+        """The table's encryption manager, or None if the table is not 
encrypted.
+
+        Raises:
+            ValueError: If the table is encrypted but no key management client 
was provided.
+        """
+        from pyiceberg.encryption.manager import EncryptionManager
+
+        return EncryptionManager.from_table_metadata(self._kms_client, 
self.metadata)

Review Comment:
   Ah this kind of thing might work, I was worried about keeping the em fresh 
as metadata changes so thought I'd do the expensive thing first but let me look 
into what you've suggested here. Thanks Matt



-- 
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]

Reply via email to