OpenStates VoteEvents are often impossible to order within a given day, because chambers often provide the date of a vote without a time of day, and because the OCD VoteEvent definition does not provide an order field similar to BillAction.
This PR provides a scraper-based stopgap means of ordering votes, by adding an order value in seconds to start_date and end_date, when they have no time-of-day component. A scraper creates a single instance of OrderVoteEvent (herein) and then passing each VoteEvent through it before emitting.
When and if an "order" value is added to VoteEvent, it could be filled by this as well. I'll start on that shortly and see how it goes.
This has been tested in situ with only a single state, New Hampshire, but I hope and believe the usage pattern is applicable to all scraper designs.
OpenStates
VoteEvent
s are often impossible to order within a given day, because chambers often provide the date of a vote without a time of day, and because the OCDVoteEvent
definition does not provide anorder
field similar toBillAction
.This PR provides a scraper-based stopgap means of ordering votes, by adding an
order
value in seconds tostart_date
andend_date
, when they have no time-of-day component. A scraper creates a single instance ofOrderVoteEvent
(herein) and then passing each VoteEvent through it before emitting.When and if an "order" value is added to VoteEvent, it could be filled by this as well. I'll start on that shortly and see how it goes.
This has been tested in situ with only a single state, New Hampshire, but I hope and believe the usage pattern is applicable to all scraper designs.