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

Data loader rework #102

Merged
merged 25 commits into from
Nov 18, 2015
Merged

Data loader rework #102

merged 25 commits into from
Nov 18, 2015

Conversation

henare
Copy link
Member

@henare henare commented Nov 18, 2015

This reworks the data loader a bit to accommodate #22.

It also simplifies the rake commands you need to run by baking in the URLs to the data (they can be changed for debugging). It's also a good time to admit that the Popolo loader tasks aren't generic but are specific to Ukraine.

Closes #22.


Example from #22

For instance, this person changes from Група "Відродження" to Група "Партія "Відродження" on 2015-06-17. If you look at a vote at the start of the day they're with the first faction and by the end of the day they're with the latter faction.

Before this change

On the first vote they're shown in Група "Партія "Відродження" as absent.

On the last vote they're shown in Група "Партія "Відродження" as absent.

This is clearly wrong.

After this change

On the first vote they're shown in Група "Партія "Відродження" as absent and in Група "Відродження" as not voting (correct).

On the last vote they're shown in Група "Відродження" as absent and in Група "Партія "Відродження" as absent (correct).

It's obviously not right to have the additional party and the extra absent record (extracted into #104)

It's also wrong on their full vote record page. It incorrectly shows him as absent because it's looking up the wrong Member record (extracted into #105).

For the above reason I imagine it's also making the attendance calculation slightly wrong too.

Conclusion

Despite the problems above, it's better than before the change and it's better that what's on the deployed site right now (which is totally wrong!). For this reason I'm going to merge.

This date has deputies change faction during the day so it covers
some helpful corner cases
It's not a generic Popolo loader any more so let's not pretend it is.
I don't think there's any reason to call them outside the methods so
hopefully this makes the intent clearer.
We need this to look up the party name (what's stored in TVFY) from
Popolo group_id (which is what the Popolo data provides).
This allows faction changes in the middle of a day.

Fixes #22

It has to fall back to not looking in the `.current_on` member scope
because our Popolo data assumes their membership starts the next day.
This is all very confusing.
This makes the same change as in 31d77bb to expand the scope of when
a member is considered to be in the house.

It means that on a day when members change parties within that day
they appear to us in both parties. As this ensures all their votes are
picked up it seems like a sensible compromise until we can do The
Right Thing (whatever that is).

It does mean that if a party changes names, some votes can have a
whole party absent where their members are actually shown in the other
party. This is a bit weird but it's not totally untrue so it's another
compromise for the moment.
@henare henare self-assigned this Nov 18, 2015
@henare henare added this to the MVP milestone Nov 18, 2015
If you run it with no arguments it will now try to load votes for
every day since the most recent one in the database.
henare added a commit that referenced this pull request Nov 18, 2015
@henare henare merged commit 926a54d into develop Nov 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant