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

feat(cli): enhance dataset listing with additional options for studio #561

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amritghimire
Copy link
Contributor

With this change, the following variation are available to list datasets
instead of datachain ls-datasets:

  • datachain datasets --local
  • datachain datasets --studio
  • datachain datasets --all (Default option)
  • datachain datasets --team TEAM_NAME
  • datachain datasets

By default, if the user has logged in to Studio using datachain studio login,
it will try to fetch the datasets from both local and studio.
If any specific option (local or studio) is passed, only that option is
passed.

The team name is parsed from config (Set by datachain studio team <TEAM_NAME>).

The same feature is added for datachain ls function and added the
error handling for each scenarios.

Relates to #10774

With this change, the following variation are available to list datasets
instead of `datachain ls-datasets`:

- `datachain datasets --local`
- `datachain datasets --studio`
- `datachain datasets --all` (Default option)
- `datachain datasets --team TEAM_NAME`
- `datachain datasets`

By default, if the user has logged in to Studio using `datachain studio login`,
it will try to fetch the datasets from both local and studio.
If any specific option (local or studio) is passed, only that option is
passed.

The team name is parsed from config (Set by  `datachain studio team <TEAM_NAME>`).

The same feature is added for `datachain ls` function and added the
error handling for each scenarios.

Relates to #10774
Copy link

cloudflare-workers-and-pages bot commented Nov 4, 2024

Deploying datachain-documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: cab2f8b
Status: ✅  Deploy successful!
Preview URL: https://b08cadfd.datachain-documentation.pages.dev
Branch Preview URL: https://amrit-extend-cli-to-studio.datachain-documentation.pages.dev

View logs

**kwargs,
):
if config is None:
from .config import Config
token = Config().read().get("studio", {}).get("token")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[I] Both ls and datasets now run the same logic to determine whether or not to call the local or studio flavour of their underlying commands. Can you pull-out the duplication, please?

[C] I would also say that IMO the default should be to reach out to Studio only if the studio or all flag is passed. Forget about the auto-token magic.

I would also say that if all is passed that we want to display a table instead of two lists:

name version studio local
cats 1
cats 2
dogs 1

That way I can easily check the discrepancies between the two. Instead of manually having to compare the two lists.

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.

2 participants