Skip to content

Commit

Permalink
Merge pull request #91 from scrapinghub/full_report
Browse files Browse the repository at this point in the history
Print full report by default
  • Loading branch information
manycoding authored May 21, 2019
2 parents a0b72b1 + 034dffb commit 94ea065
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Note that the top-most release is changes in the unreleased master branch on Git
## [0.3.6dev] (Work In Progress)
### Added
### Changed
- `Arche.report_all()` does not shorten report by default, added `short` parameter.
### Fixed
- `Arche.glance()`, #88
- Item links in Schema validation errors, #89
Expand Down
7 changes: 4 additions & 3 deletions src/arche/arche.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def __init__(
target: a data source to compare with
start: an item number to start reading from
count: the amount of items to read from start
filters: Scrapinghub filtering
filters: Scrapinghub filtering, see
https://python-scrapinghub.readthedocs.io/en/latest/client/apidocs.html#scrapinghub.client.items.Items # noqa
expand: if True, use flattened data in garbage rules, affects performance
see flatten_df
"""
Expand Down Expand Up @@ -124,12 +125,12 @@ def get_items(
def save_result(self, rule_result):
self.report.save(rule_result)

def report_all(self):
def report_all(self, short: bool = False) -> None:
self.run_all_rules()
IPython.display.clear_output()
self.report.write_summaries()
self.report.write("\n" * 2)
self.report.write_details(short=True)
self.report.write_details(short)

def run_all_rules(self):
if isinstance(self.source_items, JobItems):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_arche.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_report_all(mocker):
mocked_run_all.assert_called_once_with(arche)
mocked_write_summary.assert_called_once_with(arche.report)
mocked_write.assert_called_once_with("\n" * 2)
mocked_write_details.assert_called_once_with(arche.report, short=True)
mocked_write_details.assert_called_once_with(arche.report, short=False)


def test_run_all_rules_job(mocker, get_cloud_items):
Expand Down

0 comments on commit 94ea065

Please sign in to comment.