Skip to content

Simplify use of local virtual refs #1416

@nbren12

Description

@nbren12

Problem

An unexpected amount of precise boilerplate is required to open a local file reference inside a local repo.
If I do not provide auth in a very specific format I will get this error:

 a virtual chunk in this repository resolves to the url prefix file:///tmp/tmpu0we8rb0/data/, to be able to fetch the chunk you need to authorize the virtual chunk container when you open/create
  │ the repository, see https://icechunk.io/en/stable/virtual/
  │
  │ context:
  │    0: icechunk::store::get
  │            with key="test_arr/c/0/0" byte_range=From(0)
  │              at icechunk/src/store.rs:198
  │
  ╰─▶ a virtual chunk in this repository resolves to the url prefix file:///path/to/subdir/, to be able to fetch the chunk you need to authorize the virtual chunk container when you open/
      create the repository, see https://icechunk.io/en/stable/virtual/

This error can be avoided by creating a credentials object like this.

    credentials = icechunk.containers_credentials({
        "file:///path/to/subdir": None
    })

In addition the credentials seem quite picky about the path "file:///path/to/subdir". In my experiments it didn't work if I passed the path to a subdir like "file:///path/to". I found this confusing since the virtual_chunk_container seems to tolerate being passed a subpath.

config.set_virtual_chunk_container(
    icechunk.VirtualChunkContainer(
        "file:///path/to",
        icechunk.local_filesystem_store(data_path),
    )
)

Proposed Solution

Local file references should not require configuring any auth.

When required like for remote stores, paths in the auth configuration should have the same meaning as in the virtual chunk container.

Additional context

test_icechunk_file_urls.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions