Skip to content

explain() sometimes marks up very long string with ^ #258

@joelostblom

Description

@joelostblom

In this example:

import check_datapackage as cdp
package_properties = cdp.example_package_properties()
del package_properties["resources"]
cdp.check(properties=package_properties, error=True)

The entire resource value is marked with ^

Image

While correct, this is not helpful and looks confusing. One possible solution would be to truncate long objects/values as .... This would not only be helpful for explain() but also avoid that we clutter the output if there is a huge input dictionary/json. So the output in this case would looks something like this (truncating everything between the first and last key):

At resources:
|
| resources: {'name': 'woolly-dormice' ... 'licenses': [{'name': 'odc-pddl'}]}
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'resources' is a required property

It would be interesting to investigate what other software package that use ^ for errors do in these situations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions