marcoaanogueira commented on code in PR #1534: URL: https://github.com/apache/iceberg-python/pull/1534#discussion_r1951669632
########## pyiceberg/table/__init__.py: ########## @@ -1086,6 +1094,78 @@ def name_mapping(self) -> Optional[NameMapping]: """Return the table's field-id NameMapping.""" return self.metadata.name_mapping() + def upsert( + self, df: pa.Table, join_cols: list[str], when_matched_update_all: bool = True, when_not_matched_insert_all: bool = True + ) -> UpsertResult: + """Shorthand API for performing an upsert to an iceberg table. Review Comment: Hey everyone, I've been following the project and found this PR really interesting! Regarding the point you mentioned, @mattmartin14, I pulled your fork and ran _make docs-build_ with these changes. Based on my tests, I believe these modifications will fix this step: - Removing self from the Args section - Indenting Example one level deeper Like this: ```suggestion """Shorthand API for performing an upsert to an iceberg table. Args: df: The input dataframe to upsert with the table's data. join_cols: The columns to join on. These are essentially analogous to primary keys when_matched_update_all: Bool indicating to update rows that are matched but require an update due to a value in a non-key column changing when_not_matched_insert_all: Bool indicating new rows to be inserted that do not match any existing rows in the table Example: Case 1: Both Parameters = True (Full Upsert) ``` -- 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