Python
Contributing to Python¶
The python integration is done via pyo3 + custom python code:
- The Rust code that directly supports the Python bindings are under
python/src
while the pure Python code lives underpython/python
. - We make wrapper classes in Rust for Dataset/Scanner/RecordBatchReader that's exposed to python.
- These are then used by LanceDataset / LanceScanner implementations that extend pyarrow Dataset/Scanner for duckdb compat.
- Data is delivered via the Arrow C Data Interface
To build the Python bindings, first install requirements:
To make a dev install:
After installing, you can run import lance
in a Python shell within the virtual environment.
To run tests and integration tests:
To run the tests on OS X, you may need to increase the default limit on the number of open files:
ulimit -n 2048