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

Unregistering breaks all commands #48

Closed
dberenbaum opened this issue Mar 10, 2022 · 2 comments · Fixed by #72
Closed

Unregistering breaks all commands #48

dberenbaum opened this issue Mar 10, 2022 · 2 comments · Fixed by #72

Comments

@dberenbaum
Copy link
Contributor

After running showcase.sh in the example repo and then unregistering a model, all commands seem to throw errors:

$ gto show
                 environment
          latest     staging production
features    None         NaN        NaN
nn        v0.0.1      v0.0.1        NaN
rf        v1.0.1      v1.0.1     v1.0.0
$ gto unregister rf v1.0.0
Unregistered rf version v1.0.0
$ gto show
Traceback (most recent call last):
  File "/Users/dave/miniforge3/bin/gto", line 8, in <module>
    sys.exit(cli())
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/gto/cli.py", line 195, in show
    click.echo(gto.api.show(repo, dataframe=True))
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/gto/api.py", line 108, in show
    for o in reg.state.objects.values()
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/gto/registry.py", line 60, in state
    state = self.env_manager.update_state(state, index)
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/gto/tag.py", line 185, in update_state
    state.objects[tag.name] = index_tag(state.objects[tag.name], tag.tag)
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/gto/tag.py", line 165, in index_tag
    obj.labels.append(label_from_tag(tag, obj))
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/gto/tag.py", line 148, in label_from_tag
    version=obj.find_version(
  File "/Users/dave/miniforge3/lib/python3.9/site-packages/gto/base.py", line 103, in find_version
    raise GTOException(
gto.exceptions.GTOException: 0 versions of object rf found, skipping unregistered
@omesser
Copy link
Contributor

omesser commented Mar 12, 2022

Happened to me as well

❯ gto unregister oded v0.0.1
Unregistered oded version v0.0.1
❯ gto audit all

=== Registration audit trail ===
Traceback (most recent call last):
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/bin/gto", line 8, in <module>
    sys.exit(cli())
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/gto/cli.py", line 214, in audit
    click.echo(gto.api.audit_registration(repo, dataframe=True))
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/gto/api.py", line 139, in audit_registration
    for o in reg.state.objects.values()
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/gto/registry.py", line 60, in state
    state = self.env_manager.update_state(state, index)
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/gto/tag.py", line 185, in update_state
    state.objects[tag.name] = index_tag(state.objects[tag.name], tag.tag)
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/gto/tag.py", line 165, in index_tag
    obj.labels.append(label_from_tag(tag, obj))
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/gto/tag.py", line 148, in label_from_tag
    version=obj.find_version(
  File "/Users/oded/.local/share/virtualenvs/gto-example-8a8TDK3V/lib/python3.9/site-packages/gto/base.py", line 103, in find_version
    raise GTOException(
gto.exceptions.GTOException: 0 versions of object oded found, skipping unregistered

@aguschin
Copy link
Contributor

Thanks, fixed this in #72 , will merge soon.

@aguschin aguschin added this to the First GTO release milestone Mar 21, 2022
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 a pull request may close this issue.

3 participants