blackmwk commented on code in PR #2650:
URL: https://github.com/apache/iceberg-rust/pull/2650#discussion_r3550665177


##########
crates/iceberg/src/table.rs:
##########
@@ -113,8 +113,15 @@ impl TableBuilder {
     /// If the table metadata has the `encryption.key-id` property set, a
     /// [`KeyManagementClient`] must be provided here so the table can build
     /// an [`EncryptionManager`]; otherwise [`Self::build`] will return an 
error.
-    pub fn kms_client(mut self, kms_client: Arc<dyn KeyManagementClient>) -> 
Self {
-        self.kms_client = Some(kms_client);
+    ///
+    /// Accepts either an `Arc<dyn KeyManagementClient>` or an
+    /// `Option<Arc<dyn KeyManagementClient>>`, so catalogs that hold an
+    /// optional client can forward it directly. Passing `None` is a no-op.
+    pub fn kms_client(

Review Comment:
   It sound reasonable to me. From a user's point, I accept both apis. But from 
a maintainer's point, I prefer the api without `Option`, since it's easier to 
maintain api consistency, otherwise we need to remember that for optional 
fields, we should accept `Option`, and other fields we don't.



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