lance-format / lance-format/lance

`LanceDataset.commit()` does not respect `storage_options`

Open
#3,549 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
7.1k
Forks
852
Avg merge
3d 18h
Merged PRs (30d)
272

Description

I am creating a Lance dataset on S3 in a distributed setting, where I need to pass access credentials. Using

storage_options = {
        "access_key_id": ...,
        "secret_access_key": ...,
        "session_token": ...,
}

works when calling lance.fragment.write_fragments(), but when committing the fragments at the end via

append_op = lance.LanceOperation.Append(fragment)
lance.LanceDataset.commit(
    dataset, 
    append_op, 
    read_version=dataset.version, 
    storage_options=storage_options,
)

I get the following error

Traceback (most recent call last):
...
  File "/code/create_lance_dataset.py", line 274, in process_dataset
    lance.LanceDataset.commit(
  File "/lib/python3.10/site-packages/lance/dataset.py", line 2392, in commit
    new_ds = _Dataset.commit(
OSError: LanceError(IO): The operation lacked the necessary privileges to complete for path data.lance/_transactions/1-9dbdbac5-b0a2-43d0-af85-5c51ab24a25f.txn: Client error with status 403 Forbidden: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>User: arn:aws:sts::my-user is not authorized to perform: s3:PutObject on resource: "arn:aws:s3:::my-bucket/data.lance/_transactions/1-9dbdbac5-b0a2-43d0-af85-5c51ab24a25f.txn" with an explicit deny in a resource-based policy</Message><RequestId>...</RequestId><HostId>...</HostId></Error>, /home/runner/work/lance/lance/rust/lance/src/io/commit.rs:117:5

I am able to commit the fragments, if I set the access credentials via env variables.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Python entry point in lance/dataset.py around LanceDataset.commit and compare its storage_options handling with lance.fragment.write_fragments(). Trace the commit path to rust/lance/src/io/commit.rs:117 and reproduce the S3 case using the credentials shown. Done means commit honors the supplied storage_options instead of requiring environment variables.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python, rust
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.