Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lamin get functionality -- UI should show Get / Load on Artifact detail page #111

Open
ap-- opened this issue Jan 30, 2025 · 4 comments
Open
Assignees

Comments

@ap--
Copy link

ap-- commented Jan 30, 2025

Hi Lamins,

Should the "query metadata about an entity" be removed from here? It's the first thing you see and I expected just a json blob or so with metadata. But instead lamin loads the entire file.

lamin --help
                                                                                             
 Usage: lamin [OPTIONS] COMMAND [ARGS]...                                                    
                                                                                             
 Configure LaminDB and perform simple actions.                                               
                                                                                             
[...]

╭─ Read & write data ───────────────────────────────────────────────────────────────────────╮
│ load      Load a file or folder.                                                          │
│ save      Save a file or folder.                                                          │
│ get       Query metadata about an entity.                                                 │
│ delete    Delete an entity.                                                               │
╰───────────────────────────────────────────────────────────────────────────────────────────╯

[...]
[user@computer]$ lamin get --help
                                                                                             
 Usage: lamin get [OPTIONS] ENTITY                                                           
                                                                                             
 Query metadata about an entity.                                                             
 Currently only works for artifact & transform and behaves like `lamin load`.                
                                                                                             
╭─ Options ─────────────────────────────────────────────────────────────────────────────────╮
│ --uid         TEXT  The uid for the entity.                                               │
│ --key         TEXT  The key for the entity.                                               │
│ --with-env          Also return the environment for a tranform.                           │
│ --help              Show this message and exit.                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────╯

typer has a concept of command aliases, I bet click has too. maybe get could be made an alias of load? Which one is considered the canonical command?

The CLI suggests load

[user@computer]$ lamin get https://lamin.ai/laminlabs/cellxgene/artifact/adAPL1SLZEi2pmJJ
! to load a file or folder, please use: lamin load https://lamin.ai/laminlabs/cellxgene/artifact/adAPL1SLZEi2pmJJ
→ connected lamindb: laminlabs/cellxgene
→ artifact is here: /Users/andreaspoehlmann/Library/Caches/lamindb/srg-main-laminlabs-us-west-2-shared-resources/models/scgen_state_dict.pt

But the UI suggests get:

Image

@falexwolf
Copy link
Member

falexwolf commented Jan 30, 2025

lamin get was renamed to lamin load back when we refactored the CLI: https://docs.lamin.ai/changelog/2024#db-0-76-10

For backward compatibility it continues to work put prints these hints that you should use load instead. The plan is to have nice metadata output similar to what you get when you call get() in the Python API (matching your intuition).

The UI should show Load just like it does for transforms. Will fix this.

@falexwolf falexwolf changed the title lamin get functionality lamin get functionality -- UI should show Load on Artifact detail page Jan 30, 2025
@falexwolf
Copy link
Member

The change that we want in the UI should go slightly further.

In the Python API, the primary way of accessing an artifact is .get().

Image

You then follow with .cache(), .load() or .open(), depending on how you want to access data.

On the CLI, lamin get could start by printing .describe(); later on it can return a to-be-decided json format (all joins performed or not).

@falexwolf falexwolf changed the title lamin get functionality -- UI should show Load on Artifact detail page lamin get functionality -- UI should show Get / Load on Artifact detail page Jan 31, 2025
@ap--
Copy link
Author

ap-- commented Jan 31, 2025

On the CLI, lamin get could start by printing .describe(); later on it can return a to-be-decided json format (all joins performed or not).

That would be great.

Ideally I can pipe this to jq for scripting at some point.

I.e. something like

lamin get --json abcd1234567890ef0001 | jq .ulabels 

@falexwolf
Copy link
Member

Yes, makes sense!

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

No branches or pull requests

3 participants