Anurag-S1ngh opened a new pull request, #4484:
URL: https://github.com/apache/iceberg-python/pull/4484

   # Rationale for this change
   
   PyIceberg can read Arrow data through `to_arrow()` and 
`to_arrow_batch_reader()`, but its own table and scan objects cannot be 
consumed by other Arrow-native libraries without an explicit PyArrow conversion.
   
   This implements the producer side of the Arrow PyCapsule interface from 
#1655. `Table`, `DataScan`, and `IncrementalAppendScan` now expose 
`__arrow_c_stream__`, which delegates to `to_arrow_batch_reader()` so scans 
keep streaming and keep their existing filter, projection, and limit behavior.
   
   The base scan classes are unchanged, so third-party scan subclasses do not 
need to implement a new abstract method.
   
   The write side is tracked separately in #2680.
   
   Closes #1655.
   
   ## Are these changes tested?
   
   Yes. Added `tests/table/test_arrow_capsule.py` covering:
   
   - consuming a `Table` directly with `pa.table(...)`
   - consuming a filtered and projected scan
   - consuming an incremental append scan
   
   - `pytest tests/ -m unit --ignore=tests/integration`: 4885 passed, 6 skipped
   - `ruff check` and `ruff format --check` pass
   - `ty check` reports nothing for the new methods
   
   ## Are there any user-facing changes?
   
   Yes. `Table`, `DataScan`, and `IncrementalAppendScan` now support the Arrow 
PyCapsule stream interface. Existing `to_arrow()` and `to_arrow_batch_reader()` 
APIs are unchanged.
   


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