jonathanc-n commented on code in PR #1301: URL: https://github.com/apache/iceberg-rust/pull/1301#discussion_r2082494488
########## crates/iceberg/src/transaction/snapshot.rs: ########## @@ -129,6 +129,13 @@ impl<'a> SnapshotProduceAction<'a> { data_files: impl IntoIterator<Item = DataFile>, ) -> Result<&mut Self> { let data_files: Vec<DataFile> = data_files.into_iter().collect(); + if data_files.is_empty() { + return Err(Error::new( + ErrorKind::InvalidArgument, + "Doesn't add any data files when fast append", Review Comment: ```suggestion "No data files were provided when adding data files to snapshot, ``` This is not only for fast append ########## crates/iceberg/src/transaction/snapshot.rs: ########## @@ -129,6 +129,13 @@ impl<'a> SnapshotProduceAction<'a> { data_files: impl IntoIterator<Item = DataFile>, ) -> Result<&mut Self> { let data_files: Vec<DataFile> = data_files.into_iter().collect(); + if data_files.is_empty() { Review Comment: I think returning a `DataInvalid` error is good enough here, I don't know if invalid argument is needed. cc @Xuanwo -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org