Skip to content
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

Washington transforms and validators #219

Open
ghing opened this issue Oct 14, 2014 · 8 comments
Open

Washington transforms and validators #219

ghing opened this issue Oct 14, 2014 · 8 comments
Assignees
Labels

Comments

@ghing
Copy link
Contributor

ghing commented Oct 14, 2014

Write the transforms and validators for Washington.

Fundamentally there should be a transform to create Candidate, Contest and Result records from the RawResult records created in the loader. Use best judgement if you want to delegate this to multiple transform classes or functions. If you encounter ambiguities or the need to standardize things in the data, these will require transforms as well.

Write validators to check values in results and whether aggregate queries match published racewide totals. I took a TDD approach and tried to write these before the transforms, but do whatever works for you.

Maryland is the only state that has transforms and validators so they're a reasonable reference.

Since these have only been implemented for one state so far, I'm open to feedback on the API.

@ericlagergren
Copy link
Member

Well the first issue I ran into is the mongoengine query set can't find any data -- even Maryland's transform returns openelex.models.DoesNotExist: Office matching query does not exist.

@ghing
Copy link
Contributor Author

ghing commented Oct 15, 2014

You probably need to run inv load_metadata.run --collection=office first.

@ericlagergren
Copy link
Member

@ghing Oh, gotcha. So I need to add the canonical names first before I write the transform portion? Because I started on the transform two days ago, but I ran into this roadblock last night and not even #python or #mongodb or mongoengine's docs could help me.

@ghing
Copy link
Contributor Author

ghing commented Oct 15, 2014

@EricLagerg Yeah, you'll need to prepopulate Office and Party records to be able to fill in the relation fields on the other models.

@ericlagergren
Copy link
Member

Gotcha also add a call at the end of why 96 on the Washington's loader module you're missing it and it breaks the loader :)


Eric Lagergren
ericlagergren.com

On Tue, Oct 14, 2014 at 9:08 PM, Geoffrey Hing notifications@github.com
wrote:

@EricLagerg Yeah, you'll need to prepopulate Office and Party records to be able to fill in the relation fields on the other models.

Reply to this email directly or view it on GitHub:
#219 (comment)

ghing added a commit that referenced this issue Oct 15, 2014
@ghing
Copy link
Contributor Author

ghing commented Oct 15, 2014

@EricLagerg done in 75a73dc. Good catch.

@ericlagergren
Copy link
Member

I'm really sorry I've been MIA since the end of last year. Long story short, life's been a bit hectic. I still intend to get this done for you guys as soon as I have a free couple days to sit down and dive back into it. Anyway, again, sorry. @ghing @dwillis

@dwillis
Copy link
Contributor

dwillis commented Feb 21, 2015

We've all been busy, so don't feel too bad. Let us know when you're back in the swing of things!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants