-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add importer and support for ONS data #171
Conversation
3461d5e
to
53b8cd8
Compare
15082ae
to
2fe0fd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach for storing these postcodes sounds good. I just have a few inline questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ADR sounds good. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal and general plan looks good to me, nice work putting this together @KludgeKML!
I've left a few comments on the ADR either suggesting clarifications or asking questions. Have also left a few drive by comments on the code but do acknowledge that it is currently draft.
b939cfa
to
90d43b5
Compare
cc5a8c0
to
46238ea
Compare
599e081
to
24fbdbb
Compare
de253e1
to
736cb0d
Compare
736cb0d
to
1024e22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work Keith! Following on from our mob review, I've gone through and left a few comments but nothing major!
- Defaults to safe values for existing postcodes - Add scopes
- Manager handles creation and update of postcode records - Presenter handles rendering of OS Places API postcodes
- removes logic around postcode management now handled by PostcodeManager - refactors logic specific to OS Places API location sets into a new class
- New sidekiq queue (queue_ons) for these tasks. - DownloadWorker task retrieves an OSNPD zip file (by URL), extracts the individual CSV files to an S3 bucket, then kicks off as many ImportWorkers as needed. - ImportWorker reads a CSV file of postcodes, creating records for any postcode not already in the database.
1024e22
to
c20f27c
Compare
c20f27c
to
d6e848e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments - LGTM 🎉
(Rendered view of ADR: https://github.com/alphagov/locations-api/blob/ons-import/docs/adr/0001-add-ons-import.md)
Adds a rake task that will kick off a worker to retrieve the current ONSPD datafile from a given address, then extract the multi_csv version of the files into an S3 bucket and kick off one new worker for each file. Workers import ONS data and create Postcode records for anything missing from the database. Returned information from client now also includes source (either "Ordnance Survey" or "Office for National Statistics"), and retired info (true/false, and retired_on date).
Todo:
Trello:
https://trello.com/c/nLhD5e2N/1872-spike-into-using-onspd-data-to-fill-in-postcode-gaps-in-locations-api