rdblue commented on code in PR #41: URL: https://github.com/apache/iceberg-python/pull/41#discussion_r1451831352
########## pyiceberg/table/__init__.py: ########## @@ -831,6 +887,46 @@ def history(self) -> List[SnapshotLogEntry]: def update_schema(self, allow_incompatible_changes: bool = False, case_sensitive: bool = True) -> UpdateSchema: return UpdateSchema(self, allow_incompatible_changes=allow_incompatible_changes, case_sensitive=case_sensitive) + def append(self, df: pa.Table) -> None: + if len(self.spec().fields) > 0: + raise ValueError("Cannot write to partitioned tables") + + snapshot_id = self.new_snapshot_id() + + data_files = _dataframe_to_data_files(self, df=df) + merge = _MergeAppend(operation=Operation.APPEND, table=self, snapshot_id=snapshot_id) + for data_file in data_files: + merge.append_datafile(data_file) Review Comment: Minor: looks like we have some inconsistency in naming. The method uses `datafile` as a single word, while the variable (and other places) use two words, `data_file`. Not a big deal, but I generally prefer using the same form in all cases so it's predictable whenever possible. -- 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