Fokko commented on code in PR #1693:
URL: https://github.com/apache/iceberg-python/pull/1693#discussion_r1965052062


##########
pyiceberg/table/upsert_util.py:
##########
@@ -86,7 +97,8 @@ def get_rows_to_update(source_table: pa.Table, target_table: 
pa.Table, join_cols
     if rows_to_update:
         rows_to_update_table = pa.concat_tables(rows_to_update)
     else:
-        rows_to_update_table = pa.Table.from_arrays([], 
names=source_table.column_names)
+        empty_arrays = [pa.array([], type=field.type) for field in 
source_table.schema]
+        rows_to_update_table = pa.Table.from_arrays(empty_arrays, 
schema=source_table.schema)

Review Comment:
   Today I learned about the existence of this function:
   ```suggestion
           rows_to_update_table = source_table.schema.empty_table()
   ```
   WDYT?



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