abnobdoss commented on code in PR #3447:
URL: https://github.com/apache/iceberg-python/pull/3447#discussion_r4703124758


##########
pyiceberg/table/__init__.py:
##########
@@ -1778,6 +1777,10 @@ def __datafusion_table_provider__(self, session: Any | 
None = None) -> IcebergDa
         ).__datafusion_table_provider__
         return provider(session)
 
+    def __arrow_c_stream__(self, requested_schema: object | None = None) -> 
object:
+        """Export this Table as an Arrow C stream (PyCapsule interface)."""
+        return 
self.scan().to_arrow_batch_reader().__arrow_c_stream__(requested_schema)

Review Comment:
   Thanks for raising this, I agree it shouldn't sneak in through this PR. I 
went with Kyle's suggestion: `__arrow_c_stream__` is only on scans now, so 
`tbl.append(other_tbl)` is still rejected and `tbl.append(other_tbl.scan())` is 
the explicit way to do it. The scan export drops field IDs the same way 
`to_arrow()` does, so the columns match by name in the other table. Happy to 
add the `Table` version in a follow-up if people want `pl.DataFrame(tbl)`.



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