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

gto show gives list index out of range error when supplied with --version #344

Open
fortminors opened this issue Mar 20, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@fortminors
Copy link

fortminors commented Mar 20, 2023

Hello! I am getting this error when I try to get the last version of the artifact at the non existent stage.

Let's say I have the following registry:

$ gto show:

╒═══════════════════════╤══════════╤═════════╕
│ name                  │ latest   │ #prod   │
╞═══════════════════════╪══════════╪═════════╡
│<artifact_name>        │ v0.0.2   │ v0.0.2  │
╘═══════════════════════╧══════════╧═════════╛

I am doing the following: $ gto show <artifact_name>#develop -r <remote_repo_url> --version

And I get the following output:

❌ Unexpected error: list index out of range
Please report it here running with '--traceback' flag: <https://github.com/iterative/gto/issues>

I believe the command should output empty string in this case, as develop stage does not exist yet.

gto show <artifact_name>#develop -r <remote_repo_url> --json gives [], so I guess it could be checked for emptiness?

$ gto doctor:

🪴  GTO Version: 0.2.7
---------------------------------
INDEX='artifacts.yaml'
TYPES=None
STAGES=None
LOG_LEVEL='INFO'
DEBUG=False
ENRICHMENTS=[]
AUTOLOAD_ENRICHMENTS=True
CONFIG_FILE_NAME='.gto'
EMOJIS=True
---------------------------------
✅  No issues found

PS:
Passing --traceback says No such option: --traceback for some reason

@aguschin
Copy link
Contributor

Thanks for reporting @fortminors! I'll investigate.

@aguschin
Copy link
Contributor

aguschin commented Mar 24, 2023

Yes, you're right!

For --traceback option, it should be put in the beginning: gto --tb show <artifact_name>#develop -r <remote_repo_url>

Do you mind contributing a fix? This should be adding a few lines, just like you described. The CI/CD will check your PR for issues - if something won't work, I'll help figuring it out.

@aguschin
Copy link
Contributor

It also worth adding a simple test just like this one https://github.com/iterative/gto/blob/main/tests/test_cli.py#L139

@aguschin aguschin added the bug Something isn't working label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants