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

Fix KeyError when running document command #74

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Fix KeyError when running document command #74

merged 1 commit into from
Nov 6, 2023

Conversation

ljvmiranda921
Copy link
Contributor

@ljvmiranda921 ljvmiranda921 commented Nov 6, 2023

Fixes a missing key when running the document command.
Related to #73

Description

I tried running spacy project document -o README.md on an old project (pre-weasel) but arrived at an error:

Traceback (most recent call last):
  File "/home/lj/.local/bin/spacy", line 8, in <module>
    sys.exit(setup_cli())
  File "/home/lj/.local/lib/python3.8/site-packages/spacy/cli/_util.py", line 87, in setup_cli
    command(prog_name=COMMAND)
  File "/home/lj/.local/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/lj/.local/lib/python3.8/site-packages/typer/core.py", line 778, in main
    return _main(
  File "/home/lj/.local/lib/python3.8/site-packages/typer/core.py", line 216, in _main
    rv = self.invoke(ctx)
  File "/home/lj/.local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/lj/.local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/lj/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/lj/.local/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/lj/.local/lib/python3.8/site-packages/typer/main.py", line 683, in wrapper
    return callback(**use_params)  # type: ignore
  File "/home/lj/.local/lib/python3.8/site-packages/weasel/cli/document.py", line 47, in project_document_cli
    project_document(project_dir, output_file, no_emoji=no_emoji)
  File "/home/lj/.local/lib/python3.8/site-packages/weasel/cli/document.py", line 115, in project_document
    "start": MARKER_START.format(marker_tag),
KeyError: 'tag'

Types of change

Bugfix

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the test suite, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

@adrianeboyd
Copy link
Contributor

Thanks, Lj!

I can confirm that this fixes the initial bug. I see that it still has some problems similar to #72 where it clobbers all the "spaCy project" mentions with "Weasel" in the README, too, which probably isn't what users would expect if they're running spacy project.

@adrianeboyd adrianeboyd merged commit 3868aab into explosion:main Nov 6, 2023
42 checks passed
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

Successfully merging this pull request may close these issues.

Error when running spacy project document on an old spaCy project
2 participants