Skip to content

Support loading dataset by tag - #84

Merged
gordonmurray merged 4 commits into
lance-format:mainfrom
dentiny:hjiang/support-branch-selection
Aug 13, 2026
Merged

Support loading dataset by tag#84
gordonmurray merged 4 commits into
lance-format:mainfrom
dentiny:hjiang/support-branch-selection

Conversation

@dentiny

@dentiny dentiny commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closes #83

Hi team, in this PR I add multi-version dataset viewing. The viewer continues to load the latest snapshot from main by default, while allowing users to select a numeric version or tag for ML experimentation and dataset comparison.

Implementation-wise, a few changes

  • Add a dataset-location field when DATA_PATH is not configured.
  • Add an optional reference field supporting:
    • main for the latest snapshot
    • A numeric version such as 1
    • A tag such as tag:base-snapshot
  • Propagate the selected location and reference through dataset API requests.
  • Display reference and dataset-loading errors in the UI.

Landing page
image

Loading dataset by default "main"
image

Loading dataset by tag and version
image

@gordonmurray

Copy link
Copy Markdown
Collaborator

Thanks Destiny, This looks promising, and the existing test suite is passing.

Could you rebase onto the current main and rerun CI? The branch predates the current 0.36.0 canonical image, so the latest compatibility path still needs verification.

After that, I think this should be ready for approval pending the manual version/tag checks.

@dentiny
dentiny force-pushed the hjiang/support-branch-selection branch from c634f48 to 4adf09a Compare August 11, 2026 20:57
@dentiny

dentiny commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Could you rebase onto the current main and rerun CI?

For sure, done.

Removing ENV DATA_PATH=/data breaks every existing deployment. The run
command in the README returns 400 instead of the dataset list, and the
startup checks in entrypoint.sh are skipped because DATA_PATH is unset.

The location field is still available. Set DATA_PATH to an empty value
with -e DATA_PATH= to select the database in the UI.

The smoke test is back to the mounted-only form. It exists to catch this
kind of break, and passing -e DATA_PATH=/data hid it.
lancedb.connect() runs Path(uri).mkdir(parents=True, exist_ok=True) for
local paths, so a location that does not exist is created on the server.
The viewer never writes to Lance data.

A local location that is not a directory now returns an error before
connect() is called. Remote URIs skip the check, because connect()
creates nothing for s3:// and the other object stores.
@gordonmurray

Copy link
Copy Markdown
Collaborator

Thanks for the rebase. The version and tag selection works well. I built a table with two versions and a tag, and main, 1, and tag:base-snapshot each returned the right rows, with total matching the selected version rather than the latest one.

I pushed two commits to your branch rather than send you round again. Both are small. If you disagree with either, say so and I will drop it.

The first restores ENV DATA_PATH=/data in the Dockerfile. Without it the run command in the README stops working, so anyone who upgrades to :latest gets an empty location box in place of their data:

docker run -p 8080:8080 -v $PWD/data:/data:ro <image>

main:        GET /datasets -> 200 {"datasets":["sample"]}
this branch: GET /datasets -> 400 "A Lance dataset location is required when DATA_PATH is not set"

Your location mode is still there. It turns on with -e DATA_PATH=, and I updated the README to describe that. I also reverted the -e DATA_PATH=/data line added to the smoke test, because that check exists to catch this kind of break and the flag hid it. With DATA_PATH unset the startup checks in entrypoint.sh were skipped as well, so the default brings those back.

The second adds a guard before lancedb.connect(). For a local path, connect() runs Path(uri).mkdir(parents=True, exist_ok=True), so a location that does not exist gets created on the server. A missing local location now returns 400 and writes nothing. Remote URIs skip the check, because connect() creates nothing for s3://.

All eight versions in the matrix pass, 42 tests each.

@dentiny

dentiny commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Sounds good, thanks for the change!

@gordonmurray
gordonmurray merged commit 66ad89f into lance-format:main Aug 13, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat]: support switch to new branch / version

2 participants