Unopposed special elections
Alabama had a state senate election last year in which only one candidate ran - there was no election and he was simply declared the winner. How do we want to handle this in the results? Create a CSV representing the race with no votes but a winner boolean set to True? (also happened here.)
How about inserting it as a clean Result record in a transform step with a related validation?
A couple of follow-on questions: do we have this election that didn't actually occur but had a "winner" in the metadata? Since in this case they are image PDFs, they'll need to be pre-processed CSVs. How do we account for them in the pipeline if we're not loading them as a RawResult?
I'd say we definitely want it entered in the metadata if it's not already there. But I'm torn about whether or not to insert this as a RawResult first, or only insert it as a Result in a subsequent transform step.
On the one hand, RawResult was intended to reflect the state of affairs of raw data. To retain fidelity to that raw data, we would avoid adding data points that don't exist in the source and instead insert them at the transform layer of the pipeline.
That said, we've discussed possibly baking out raw results as a way to provide a quick win for end users. I'd hate for those baked results not to include this extra data point, especially since it would be so easy to add a RawResult record for it.
If you and @ghing think this is a compelling reason to insert the record as a RawResult data loader stage, I could live with that. Otherwise, I think we should insert the record as a Contest, Candidate and Result record in a standalone transform step, in order to make this value-add explicit in our data pipeline.
In either case, I would manually build the necessary model instances in code rather than storing the data points in an external CSV. Also, do we need some type of indicator (beyond the blank vote counts) to make clear that we've created a record where none existed?
Ok, I've put these in the metadata. I think there is a compelling reason to have it inserted as a RawResult, at least based on what I've seen for Alabama, where the Secretary of State issues a certificate of election in these cases. So while there is no election, there is a "result", if you will. I'm fine doing it in the code as opposed to CSV, although I don't think it's a big deal either way and would be fine having a CSV for it, too.
Whichever approach, I think we do need some kind of note attribute explaining the situation.
Sounds good. Regarding indicator, how about an unopposed boolean on RawResult and Contest?
+1 to unopposed boolean. @ghing?
I think the unopposed boolean flag sounds good. This seems like a common enough case that it warrants its own flag.
Note that we also need to handle the fact that votes is a required field on Result. The simplest way is to just set votes to 0 and add text in the notes field.
On Mon, May 5, 2014 at 4:00 PM, Derek Willis [email protected]:
+1 to unopposed boolean. @ghing https://github.com/ghing?
— Reply to this email directly or view it on GitHubhttps://github.com/openelections/core/issues/137#issuecomment-42238882 .
Geoffrey Hing [email protected] 773.969.6436 http://geoff.terrorware.com/ Twitter: @geoffhing