Skip to content

Output from explain(issues) is currently not that helpful when run on its own without check(..., error=True) #263

@joelostblom

Description

@joelostblom

If I currently run explain on a set of issues, the return is not that useful since it is a string with markup for formatting:

import check_datapackage as cdp
package_properties = cdp.example_package_properties()
del package_properties["resources"][0]["path"]
issues = cdp.check(properties=package_properties)
cdp.explain(issues)
Image

If we want explain to be used this way, I think we need to rethink the output from it both with and without error=True. A few guiding questions:

  1. Do we want explain to be a public function runnable from code by the user or a helper function to nicely format DataPackageError?
    • Currently, we have hardcoded the path datapackage.json in the explain output, that would need to change if explain is a public function that is run on other input than this json file.
  2. If explain is a public function, should it return a string that the user can do something with or just print a helpful message.
  3. If explain is a public function runnable from code, then how should it interface with DataPackageError?
    • E.g. if we add a print directly in explain and then run check(..., error=True), all the printed output from explain will appear above the line that says DataPackageError, something like this:
      Image

Tagging @martonvago and @lwjohnst86 since we worked on the explain implementation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions