Repository: openstates/openstates-scrapers

Issue:
OH failing since at least 2018-05-21
OH has been failing since 2018-05-21

Based on automated runs it appears that OH has not run successfully in 3 days (2018-05-21).


```
  03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Adam Miller"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Nathan Manning"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Jeff Rezabek"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "John Barnes"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Janine Boyd"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Richard Brown"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Hearcel Craig"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Tim Ginter"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Glenn Holmes"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "James Hoops"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "George Lang"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Craig Riedel"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Mark Romanchuk"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Robert Sprague"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Riordan McClain"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Louis Blessing"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "P. Lipps"}
03:07:57 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Tom Brinkman"}
loaded Open States pupa settings...
oh (scrape, import)
  people: {}
  bills: {}
import jurisdictions...
import organizations...
import people...
import posts...
import memberships...
import bills...
Traceback (most recent call last):
  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 68, in main
    subcommands[args.subcommand].handle(args, other)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 260, in handle
    return self.do_handle(args, other, juris)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 307, in do_handle
    report['import'] = self.do_import(juris, args)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 213, in do_import
    report.update(bill_importer.import_directory(datadir))
  File "/opt/openstates/venv-pupa/src/pupa/pupa/importers/base.py", line 196, in import_directory
    return self.import_data(json_stream())
  File "/opt/openstates/venv-pupa/src/pupa/pupa/importers/base.py", line 233, in import_data
    obj_id, what = self.import_item(data)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/importers/base.py", line 254, in import_item
    data = self.prepare_for_db(data)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/importers/bills.py", line 58, in prepare_for_db
    action['organization_id'])
  File "/opt/openstates/venv-pupa/src/pupa/pupa/importers/base.py", line 171, in resolve_json_id
    raise UnresolvedIdError(errmsg)
pupa.exceptions.UnresolvedIdError: cannot resolve pseudo id to Organization: ~{"classification": "executive"}
```

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



Discussion:
@showerst Tim, this looks like fallout from https://github.com/openstates/openstates/pull/2293 
I think james' commit this morning might've fixed this -- https://github.com/openstates/openstates/commit/96d2f020e4327a3ad093239155c9aadbd0727ea4
@showerst Ah, yes indeed!
Looks like this is failing now because we use `revno` as the `pupa_id` for votes, but we're getting multiple votes with the same value: there are votes in http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/bills/hb159/cmtevotes and http://search-prod.lis.state.oh.us/solarapi/v1/general_assembly_132/bills/hb10/cmtevotes with a `revno` of 576333. Maybe the unique id for votes should be `revno` concatenated with the bill name, or something else--but will we get a bunch of duplicate votes if we change the unique id now?

cc @jamesturk 
ping @jamesturk @showerst 
Seems to me like the best thing to do is to blow away all the existing OH votes for this session, then change the pupa IDs. 

On the openstates side that would be a @jamesturk move.

Resolving patch:
diff --git a/openstates/oh/bills.py b/openstates/oh/bills.py
--- a/openstates/oh/bills.py
+++ b/openstates/oh/bills.py
@@ -423,7 +423,8 @@ def process_vote(self, votes, url, base_url, bill, legislators, chamber_dict, vo
                                  classification='passed',
                                  bill=bill
                                  )
-            vote.pupa_id = str(v['revno'])
+            # Concatenate the bill identifier and vote identifier to avoid collisions
+            vote.pupa_id = '{}:{}'.format(bill.identifier.replace(' ', ''), v['revno'])
             # the yea and nay counts are not displayed, but vote totals are
             # and passage status is.
             yes_count = 0


Test patch: