Skip to content

Commit

Permalink
Make unique key an int
Browse files Browse the repository at this point in the history
  • Loading branch information
jnothman committed Nov 15, 2017
1 parent 3ae50ca commit 0961db8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
df = openaustraliamembers.OpenAustraliaMembers().offices().reset_index()
df.todate = df.todate.astype(str)
df.fromdate = df.fromdate.astype(str)
scraperwiki.sqlite.save(unique_keys=['office_id'],
df['office_id_number'] = df.office_id.map(lambda s: int(s.rpartition('/')[-1]))
scraperwiki.sqlite.save(unique_keys=['office_id_number'],
data=df.to_dict(orient='records'))

0 comments on commit 0961db8

Please sign in to comment.