CartoDB / observatory-extension

BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

Fix broken tests due to different test points #307

Closed javitonino closed 7 years ago

javitonino commented 7 years ago

The testing code has different test points per numerator.

We recently added school district geonames, there are three columns: "unified", "elementary" and "secondary". In some parts of the US, we only have data for the first one, and in the rest, for the last two. Basically, in some states the school districts are unified and in others they are split, so we need different test points for each of them.

The problem is that the points are run in groups of 50 and the test point is calculated for the first numerator in the group. This is incorrect, since groups of 50 numerators might have different test points.

This worked until now because the query to list numerators, groups by tags which is good enough for the rest of measures. But in the case of school districts this is not true.

A better solution would be to remove the GROUP from the query, and do the grouping based on test points.