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

TypeError when completion json file doesn't exists #47

Closed
sp1thas opened this issue Sep 11, 2019 · 1 comment
Closed

TypeError when completion json file doesn't exists #47

sp1thas opened this issue Sep 11, 2019 · 1 comment
Labels
problem bug or something isn't working

Comments

@sp1thas
Copy link

sp1thas commented Sep 11, 2019

When I tried use Image object detection without initializing the completion files I noticed the following error:

Traceback (most recent call last):
  File "/home/username/label-studio/backend/utils.py", line 70, in exception_f
    return f(*args, **kwargs)
  File "/home/username/label-studio/backend/server.py", line 164, in api_completions
    completion_id = db.save_completion(task_id, completion)
  File "/home/username/label-studio/backend/db.py", line 199, in save_completion
    if 'completions' not in task:
TypeError: argument of type 'NoneType' is not iterable

the above error occurs then I hit "submit" because "$task_id".json is missing from the output folder.

I believe that we can bypass this unpleasant case by changing backend.db.get_completions function in that way so when the completion file is missing, an empty dictionary will be returned

@shevchenkonik
Copy link
Contributor

@sp1thas Hey!

Please check the changes in the PR (#46).

@sp1thas sp1thas closed this as completed Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem bug or something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants