daft.read_lance

Contents

daft.read_lance#

read_lance(url: str, io_config: Optional[IOConfig] = None) DataFrame[source]#

Create a DataFrame from a LanceDB table.

Note

This function requires the use of LanceDB, which is the Python library for the LanceDB project.

To ensure that this is installed with Daft, you may install: pip install daft[lance]

Examples:#

Read a local LanceDB table:
>>> df = daft.read_lance("s3://my-lancedb-bucket/data/")
>>> df.show()
Read a LanceDB table from a public S3 bucket:
>>> from daft.io import S3Config
>>> s3_config = S3Config(region="us-west-2", anonymous=True)
>>> df = daft.read_lance("s3://daft-public-data/lance/words-test-dataset", io_config=s3_config)
>>> df.show()
param url:

URL to the LanceDB table (supports remote URLs to object stores such as s3:// or gs://)

param io_config:

A custom IOConfig to use when accessing LanceDB data. Defaults to None.

returns:

a DataFrame with the schema converted from the specified LanceDB table

rtype:

DataFrame