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

Better results API #98

Open
manycoding opened this issue May 27, 2019 · 0 comments
Open

Better results API #98

manycoding opened this issue May 27, 2019 · 0 comments
Labels
Type: Feature New feature or request Type: Question Further information is requested

Comments

@manycoding
Copy link
Contributor

To allow report customization, results can have a better API. The current one looks like:

arche.report.results.get("JSON Schema Validation")

Result(
    name='JSON Schema Validation',
    messages={
        <Level.ERROR: 2>:[
            Message(summary='34021 items were checked, 3 error(s)',
                            detailed=None,
                            errors=defaultdict(<class 'set'>, {
                                "'FRANCHISE' is a required property": {
                                    '2235/1375/40/347696',...'2235/1375/40/477297'}}))
        ],
        <Level.ERROR: 1>:[
            Message(summary=...)]},
    items_count=34021,
    err_items_count=16282,
    _stats=_pd.Series and pd.DataFrames_,
    _figures=_plotly figures from _stats_
)
{
  "field": "FRANCHISE",
  "items_affected": 16282,
  "items_sample": [
    {
      "id": 367187,
      "url": "https://app.scrapinghub.com/p/1/1375/40/item/367187"
    },
    "..."
  ],
  "items_total": 34021,
  "reason": "is a required property"
}
  1. Expose error field
  2. Keep both id and url?
@manycoding manycoding added Type: Feature New feature or request Type: Question Further information is requested labels May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request Type: Question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant