electiondata
electiondata copied to clipboard
Consolidate SQL used in analyzer
There is a lot of repeated SQL in the database module that is used only by the Analyzer. This varies only in a couple areas: the select statement and the Candidate vs BallotMeasure joins. See here, here, and here.
These should be consolidated into one function that creates the SQL to support the various areas where the query is used.
@ericmtsai - yup - there's got to be a cleaner way to do this stuff.
If you want at some point we can walk through the surrounding code (and the data pipeline as a whole) and try to figur something out.