Skip to content

CLI import-based commands fail with too few information on importing COCO directory with different categories in files #89

@zhiltsov-max

Description

@zhiltsov-max

test_coco_error_reporting.zip

Download, unzip, run info command:

$ datum info "test/:coco_person_keypoints"
ERROR:root:Failed to parse revspec:
  Can't find project at 'Failed to find project at 'test/'. Specify project path with '-p/--project' or in the target pathspec.'
  Failed to import dataset 'coco_person_keypoints' at 'test/'.

Changing

class WrongRevpathError(CliException):
to:

@attrs
class WrongRevpathError(CliException):
    problems = attrib()

    def __str__(self):
        return "Failed to parse revspec:\n  " + "\n  ".join(str(getattr(p, "__cause__") or p) for p in self.problems)

Allows to improve the returned message:

$ datum info "test/:coco_person_keypoints"
ERROR:root:Failed to parse revspec:
  Can't find project at 'Failed to find project at 'test/'. Specify project path with '-p/--project' or in the target pathspec.'
  Merging of datasets with different categories is only allowed in 'merge' command.

It still can be better, but it already helps to understand the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions