File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,25 @@ This repository contains Python bindings for Rust's DataFusion.
2323- The repository mixes Python and Rust; ensure changes build for both languages.
2424- If adding new dependencies, update ` pyproject.toml ` and run ` uv sync --dev --no-install-package datafusion ` .
2525
26+ ## Refactoring opportunities
27+ - Avoid using private or low-level APIs when a stable, public helper exists. For example,
28+ automated refactors should spot and replace uses:
29+
30+ ``` python
31+ # Before (uses private/low-level API)
32+ # PyArrow example
33+ reader = pa.RecordBatchReader._import_from_c_capsule(
34+ df.__arrow_c_stream__()
35+ )
36+
37+ # After (use public API)
38+ reader = pa.RecordBatchReader.from_stream(df)
39+ ```
40+
41+ Look for call chains that invoke `_import_from_c_capsule` with `__arrow_c_stream__()`
42+ and prefer `from_stream(df)` instead. This improves readability and avoids
43+ relying on private PyArrow internals that may change.
44+
2645# # Helper Functions
2746- `python/ datafusion/ io.py` offers global context readers:
2847 - `read_parquet`
You can’t perform that action at this time.
0 commit comments