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

Update queries to better match pw export #1812

Merged
merged 2 commits into from
Aug 19, 2024
Merged

Conversation

ajparsons
Copy link
Contributor

Adjusts the export for twfy-votes to more closely mirror the original public whip data table dumps.

- PW export had more info on debate gids, and memberships
@ajparsons ajparsons requested a review from dracos July 23, 2024 09:55
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one query is all

ON persondivisionvotes.division_id = divisions.division_id
JOIN member
ON persondivisionvotes.person_id = member.person_id
AND divisions.division_date BETWEEN member.entered_house AND member.left_house;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will have an issue if someone is in two houses at once, that both have divisions, won't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right - it needs to also have a divisions.house = member.house I think? I'll give that a go at some point and check it outputs correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, fix in a new commit which I'll squish. divisions.house is string and member.house is int so it needs the conversion in the query. Adding this slightly decreased the number of divisions being exported as you'd hope.

@ajparsons ajparsons self-assigned this Aug 7, 2024
@ajparsons ajparsons requested a review from dracos August 7, 2024 13:11
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this is okay

@ajparsons ajparsons merged commit 4086564 into master Aug 19, 2024
8 checks passed
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.

2 participants