Repository: openstates/openstates-scrapers

Issue:
OH failing since at least 2017-12-23
OH has been failing since 2017-12-23

Based on automated runs it appears that OH has not run successfully in 2 days (2017-12-23).


```
  23:01:27 INFO pupa: save post 85 as post_7fa5619a-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 86 as post_7fa562c6-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 88 as post_7fa56550-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 87 as post_7fa563fc-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 89 as post_7fa56690-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 90 as post_7fa567d0-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 91 as post_7fa56906-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 92 as post_7fa56a32-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 93 as post_7fa56bb8-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 94 as post_7fa56d02-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 95 as post_7fa56e38-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 97 as post_7fa570c2-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 96 as post_7fa56f8c-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 98 as post_7fa57202-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save post 99 as post_7fa57338-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save organization Democratic as organization_7fafd56c-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO pupa: save organization Republican as organization_7fafbd70-e867-11e7-97ee-0242ac110002.json
23:01:27 INFO scrapelib: GET - http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/chamber/House/legislators?per_page=100
23:01:27 INFO pupa: no session, using 132
23:01:57 INFO scrapelib: GET - http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/chamber/Senate/legislators?per_page=100
23:02:06 INFO scrapelib: GET - http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/amendments
23:02:07 INFO scrapelib: GET - http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/fiscals
23:02:09 INFO scrapelib: GET - http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/synopsiss
23:02:09 INFO scrapelib: GET - http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/analysiss
23:02:11 INFO scrapelib: GET - https://www.legislature.ohio.gov/legislation?pageSize=500&start=1&sort=LegislationNumber&dir=asc&statusCode&generalAssemblies=132
23:02:25 INFO scrapelib: GET - http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/resolutions/hjr1/
23:02:26 INFO scrapelib: GET - http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/resolutions/hjr1/actions
23:02:27 INFO scrapelib: GET - http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/resolutions/hjr1/votes
no pupa_settings on path, using defaults
oh (scrape, import)
  bills: {}
  people: {}
    return self.do_handle(args, other, juris)
  File "/opt/openstates/venv-pupa//bin/pupa", line 11, in <module>
    load_entry_point('pupa', 'console_scripts', 'pupa')()
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/__main__.py", line 67, in main
    subcommands[args.subcommand].handle(args, other)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 260, in handle
Traceback (most recent call last):
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 305, in do_handle
    report['scrape'] = self.do_scrape(juris, args, scrapers)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 173, in do_scrape
    report[scraper_name] = scraper.do_scrape(**scrape_args)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/scrape/base.py", line 111, in do_scrape
    for obj in self.scrape(**kwargs) or []:
  File "/opt/openstates/openstates/openstates/oh/bills.py", line 200, in scrape
    chamber_dict, vote_results)
  File "/opt/openstates/openstates/openstates/oh/bills.py", line 415, in process_vote
    vote.yes(legislators[voter_id])
KeyError: 1605
```

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



Discussion:

Resolving patch:
diff --git a/openstates/oh/bills.py b/openstates/oh/bills.py
--- a/openstates/oh/bills.py
+++ b/openstates/oh/bills.py
@@ -333,8 +333,8 @@ def get_legislator_ids(self, base_url):
             doc = self.get(url.format(chamber=chamber))
             leg_json = doc.json()
             for leg in leg_json["items"]:
-                legislators[leg["med_id"]] = leg["displayname"]
-
+                if leg["med_id"]:
+                    legislators[int(leg["med_id"])] = leg["displayname"]
         return legislators
 
     def get_sponsor_name(self, sponsor):


Test patch: