Skip to main content

Lance Plugin

This plugin adds a "lance" format to the Flyte DataFrame, so a Lance dataset can be passed between tasks as a typed flyte.io.DataFrame.

Lance is a columnar, multimodal, streaming-optimized format. Its central property is that a dataset is opened lazily and streamed on demand — sequentially for a scan or by random access for shuffled training — without materializing the whole thing in memory. This plugin preserves that: the primary decoder hands back a live lance.LanceDataset handle you can stream from, not a materialized table.

The plugin registers:

  • lance.LanceDataset as the default in-memory type for the "lance" format — encoded by copying the dataset to Flyte-managed storage, decoded lazily via lance.dataset(uri). This is the streaming path.
  • pyarrow.Table for the "lance" format, for handing off an in-memory table. Because pyarrow.Table already defaults to Parquet, this is the one case where you opt into Lance explicitly, with Annotated[DataFrame, "lance"]. Encoded with lance.write_dataset and decoded eagerly with dataset.to_table(), which materializes the whole dataset — prefer lance.LanceDataset for large or multimodal data.

Object-store credentials are threaded through Lance's storage_options from Flyte's storage configuration, so remote reads and writes go through the same credentials as the rest of Flyte.

To install the plugin, run the following command:

pip install flyteplugins-lance

Usage:

import tempfile

import flyte
import lance
import pyarrow as pa

# Installing the plugin in the task image is all that is needed. Flyte discovers
# it through the flyte.plugins.types entry point and registers the "lance" format
# automatically, so there is nothing to import in your task code.
env = flyte.TaskEnvironment(
    name="lance-example",
    image=flyte.Image.from_debian_base().with_pip_packages("flyteplugins-lance"),
)


@env.task
async def make() -> lance.LanceDataset:
    uri = f"{tempfile.mkdtemp()}/example.lance"
    lance.write_dataset(pa.table({"id": [1, 2, 3]}), uri)
    return lance.dataset(uri)  # encoded as "lance" — the default format for a LanceDataset


@env.task
async def consume(ds: lance.LanceDataset) -> int:
    return ds.count_rows()  # a live, streaming handle — no wrapper, no .open()


@env.task
async def main() -> int:
    return await consume(await make())

Metadata

Release files for flyteplugins-lance 2.12.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for flyteplugins-lance 2.12.3
File Interpreter ABI Platform Actions
flyteplugins_lance-2.12.3-py3-none-any.whl Python 3 none any Details for flyteplugins_lance-2.12.3-py3-none-any.whl

Release files / flyteplugins_lance-2.12.3-py3-none-any.whl

Download URL flyteplugins_lance-2.12.3-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57bfb5b85f2794029f27a70b33bee719466314f80858fb4f1af8dc36fc64c741
BLAKE2b-256 checksum
How to use checksums
044ea9ec967d4d3ccd7c6c172fbbc576f48139ed3eedcc76ad73083d3624dd56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.17

Security for flyteplugins-lance 2.12.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.12.3 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page