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

additional_checks: Group by type #17

Merged
1 commit merged into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cove_ofds/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from libcoveweb2.models import SuppliedDataFile
from libcoveweb2.process import ProcessDataTask
from libcoveweb2.utils import group_data_list_by


class WasJSONUploaded(ProcessDataTask):
Expand Down Expand Up @@ -317,5 +318,9 @@ def get_context(self):
with open(self.checks_and_stats_filename) as fp:
context.update(json.load(fp))
context["additional_checks_count"] = len(context["additional_checks"])
context["additional_checks"] = group_data_list_by(
context["additional_checks"], lambda i: i["type"]
)
print(context["additional_checks"])
# done!
return context
Loading