Skip to content

get_disaggregated_stats() returns wrong counts #190

Open
@jnm

Description

As discovered by @noliveleger, counter['__submissions__'] contains the count of all submissions, including those where no response was provided. This leads to total_count exceeding the total number of submissions.

def get_disaggregated_stats(self, metrics, top_splitters,
lang=UNSPECIFIED_TRANSLATION, limit=100):
not_provided = 0
provided = 0
for val, counter in metrics.items():
not_provided += counter.pop(None, 0)
provided += counter.pop('__submissions__', 0)
return {
'total_count': not_provided + provided,

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions