Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Two Copies of council members #125

Open
tohuynh opened this issue Jan 29, 2020 · 0 comments
Open

Two Copies of council members #125

tohuynh opened this issue Jan 29, 2020 · 0 comments

Comments

@tohuynh
Copy link
Collaborator

tohuynh commented Jan 29, 2020

Description

In particular there are two copies of Andrew J. Lewis, Dan Strauss, and Tammy J. Morales.
image.
The duplicate council members doesn't have any other biographical info besides full_name.

Cause

Probably at one point these council members (because they are new) didn't have the full biographical info on Legistar. These council members, without an email, gets added to our database. Then at a later date, new biographical info gets added to Legistar. So that when we process a new event and call get_or_upload_person with the args full_name and new not None email, it will actually upload a new council member with the same full_name.

Solutions

Delete duplicate council members from our db, and use the single event pipeline to attach the voting records of the duplicate council member to the right council member. Or you can do it manually as there are only two voting records per duplicate council member.

How to avoid this little bug in the future?
In _get_or_upload_row, if row is not found and len(pks) > 1, then try to find the right row by querying combinations of the pks. For example, if pks is [("a", 1), ("b",2), ("c",3)] then the combinations could be:
[("a", None), ("b",2), ("c",3)]
[("a", 1), ("b",None), ("c",3)]
[("a", 1), ("b",2), ("c",None)]

[("a", 1), ("b",None), ("c",None)]
[("a", None), ("b",2), ("c",None)]
[("a", None), ("b",None), ("c",3)]

Try to find the right row using the first set. If first set couldn't find a row or agree on one row, then try the second set.

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

No branches or pull requests

1 participant