Repository: openstates/openstates-scrapers

Issue:
CO failing since at least 2019-01-20
CO has been failing since 2019-01-20

Based on automated runs it appears that CO has not run successfully in 2 days (2019-01-20).


```
  07:05:20 INFO pupa: save bill HB19-1057 in 2019A as bill_e9fba3ba-1d4a-11e9-833d-028e1495c01c.json
07:05:20 INFO scrapelib: GET - http://leg.colorado.gov/bills/hb19-1015
07:05:21 INFO pupa: save bill HB19-1015 in 2019A as bill_ea966a3a-1d4a-11e9-833d-028e1495c01c.json
07:05:21 INFO scrapelib: GET - http://leg.colorado.gov/bills/hb19-1117
07:05:22 INFO pupa: save bill HB19-1117 in 2019A as bill_eb2d9e5a-1d4a-11e9-833d-028e1495c01c.json
07:05:22 INFO scrapelib: GET - http://leg.colorado.gov/bills/hb19-1035
07:05:23 INFO pupa: save bill HB19-1035 in 2019A as bill_ebc66752-1d4a-11e9-833d-028e1495c01c.json
07:05:23 INFO scrapelib: GET - http://leg.colorado.gov/bills/hb19-1059
07:05:24 INFO scrapelib: GET - http://leg.colorado.gov/content/395ab08fd5fa943f8725838300740d12-hearing-summary
07:05:25 INFO pupa: save bill HB19-1059 in 2019A as bill_ec5eb4e4-1d4a-11e9-833d-028e1495c01c.json
07:05:25 INFO scrapelib: GET - http://leg.colorado.gov/bills/hb19-1106
07:05:26 INFO pupa: save bill HB19-1106 in 2019A as bill_ed902564-1d4a-11e9-833d-028e1495c01c.json
07:05:26 INFO scrapelib: GET - http://leg.colorado.gov/bills/hb19-1021
07:05:27 INFO pupa: save bill HB19-1021 in 2019A as bill_ee28cc88-1d4a-11e9-833d-028e1495c01c.json
07:05:27 INFO scrapelib: GET - http://leg.colorado.gov/bills/hb19-1060
07:05:28 INFO pupa: save bill HB19-1060 in 2019A as bill_eec1c1d6-1d4a-11e9-833d-028e1495c01c.json
07:05:28 INFO scrapelib: GET - http://leg.colorado.gov/bills/hb19-1068
07:05:29 INFO pupa: save bill HB19-1068 in 2019A as bill_ef5a3a2e-1d4a-11e9-833d-028e1495c01c.json
07:05:29 INFO scrapelib: GET - http://leg.colorado.gov/bills/hb19-1029
07:05:30 INFO pupa: save bill HB19-1029 in 2019A as bill_eff36b36-1d4a-11e9-833d-028e1495c01c.json
07:05:30 INFO scrapelib: GET - http://leg.colorado.gov/content/hb19-1029vote65e72e
07:05:31 INFO pupa: save vote_event 2019A - 2019-01-18 00:00:00-07:00 - AMD as vote_event_f08bbc4c-1d4a-11e9-833d-028e1495c01c.json
loaded Open States pupa settings...
co (scrape, import)
  bills: {}
Traceback (most recent call last):
  File "/opt/**PGUSER**/venv-pupa//bin/pupa", line 11, in <module>
    load_entry_point('pupa', 'console_scripts', 'pupa')()
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/cli/__main__.py", line 68, in main
    subcommands[args.subcommand].handle(args, other)
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 278, in handle
    return self.do_handle(args, other, juris)
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 327, in do_handle
    report['scrape'] = self.do_scrape(juris, args, scrapers)
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 175, in do_scrape
    report[scraper_name] = scraper.do_scrape(**scrape_args)
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/scrape/base.py", line 117, in do_scrape
    self.save_object(obj)
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/scrape/base.py", line 100, in save_object
    raise ve
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/scrape/base.py", line 97, in save_object
    obj.validate()
  File "/opt/**PGUSER**/venv-pupa/src/pupa/pupa/scrape/base.py", line 195, in validate
    self.__class__.__name__, self._id, '\n\t'+'\n\t'.join(errors)
pupa.exceptions.ScrapeValueError: validation of VoteEvent f08bbc4c-1d4a-11e9-833d-028e1495c01c failed: 
	-1 is less than the minimum of 0
Failed validating 'minimum' in schema['properties']['counts']['items']['properties']['value']:
    {'minimum': 0, 'type': 'integer'}
On instance['counts'][3]['value']:
    -1
```

Visit http://bobsled.openstates.org for more info.



Discussion:

Resolving patch:
diff --git a/openstates/co/bills.py b/openstates/co/bills.py
--- a/openstates/co/bills.py
+++ b/openstates/co/bills.py
@@ -351,6 +351,11 @@ def scrape_vote(self, bill, vote_url, chamber, date):
             if abstain_counts:
                 abstain_count = int(abstain_counts[0])
 
+            # fix for
+            # http://leg.colorado.gov/content/hb19-1029vote65e72e
+            if absent_count == -1:
+                absent_count = 0
+
             passed = yes_count > no_count
             vote = VoteEvent(chamber=chamber,
                              start_date=self._tz.localize(date),


Test patch: