Repository: openstates/openstates-scrapers

Issue:
PR failing since at least 2018-09-06
PR has been failing since 2018-09-06

Based on automated runs it appears that PR has not run successfully in 3 days (2018-09-06).


```
  00:38:11 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Carlos J. Rodr\u00edguez Mateo"}
00:38:11 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Roberto Rivera Ruiz De Porras"}
00:38:11 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Guillermo Miranda Rivera"}
00:38:11 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Antonio L. Soto Torres"}
00:38:11 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Jos\u00e9 J. P\u00e9rez Cordero"}
00:38:11 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Jos\u00e9 F. Aponte Hern\u00e1ndez"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Nelson Del Valle Col\u00f3n"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Evelyn V\u00e1zquez Nieves"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Mar\u00eda de Lourdes Ramos Rivera"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Migdalia Padilla Alvelo"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Jes\u00fas Manuel Ortiz Gonz\u00e1lez"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Jos\u00e9 L. Dalmau Santiago"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Mar\u00eda M. Charbonier Laureano"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Juan O. Morales Rodr\u00edguez"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Angel J. Mart\u00ednez Santiago"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Abel Nazario Qui\u00f1ones"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Axel (Chino) Roque Gracia"}
00:38:12 ERROR pupa: cannot resolve pseudo id to Person: ~{"name": "Jorge Navarro Su\u00e1rez"}
loaded Open States pupa settings...
pr (scrape, import)
  people: {}
  committees: {}
  bills: {}
import jurisdictions...
import organizations...
import people...
import posts...
import memberships...
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 211, in do_import
    report.update(membership_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/memberships.py", line 50, in prepare_for_db
    data['post_id'] = self.post_importer.resolve_json_id(data['post_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 Post: ~{"label": "At-Large", "organization__classification": "lower"}
```

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



Discussion:

Resolving patch:
diff --git a/openstates/pr/__init__.py b/openstates/pr/__init__.py
--- a/openstates/pr/__init__.py
+++ b/openstates/pr/__init__.py
@@ -60,14 +60,16 @@ def get_organizations(self):
         for i, d in enumerate(('I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII')):
             upper.add_post(label=d, role=upper_title,
                            division_id='{}/sldu:{}'.format(self.division_id, i + 1))
+        upper.add_post(label='At-Large', role=upper_title,
+                       division_id='{}/sldu'.format(self.division_id))
 
         # lower house is 40 seats, + 11 at large
         for n in range(1, 41):
             lower.add_post(
                 label=str(n), role=lower_title,
                 division_id='{}/sldl:{}'.format(self.division_id, n))
-
-        # TODO: add at large
+        lower.add_post(label='At-Large', role=lower_title,
+                       division_id='{}/sldl'.format(self.division_id))
 
         yield Organization(name='Office of the Governor', classification='executive')
         yield legislature


Test patch: