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

get_disaggregated_stats() returns wrong counts #190

Open
jnm opened this issue Dec 20, 2018 · 0 comments · May be fixed by #191
Open

get_disaggregated_stats() returns wrong counts #190

jnm opened this issue Dec 20, 2018 · 0 comments · May be fixed by #191

Comments

@jnm
Copy link
Member

jnm commented Dec 20, 2018

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants