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

VA: Fix duplicate vote bug with votes import #5072

Merged
merged 2 commits into from
Nov 5, 2024
Merged

Conversation

jessemortenson
Copy link
Contributor

VA vote events were failing to import with errors like:

INFO - [base] openstates.exceptions.DuplicateItemError: attempt to import data that would conflict with data already in the import: {'identifier': '', 'motion_text': 'Reported with amendments', 'motion_classification': [], 'start_date': '2024-01-31', 'result': 'pass', 'extras': {}, 'dedupe_key': 'H092024-01-311', 'legislative_session_id': UUID('27766658-dae9-4950-8565-ca0a88ea931e'), 'organization_id': 'ocd-organization/0c3daf42-2835-49cf-8f58-b1d771dae687', 'bill_id': 'ocd-bill/61eb4a36-d3f6-4855-a913-7f45613910e2', 'bill_action_id': UUID('37298987-68ef-4d79-99d8-6a8dec9fa5e2')} (already imported as Reported with amendments on HB 582 in Virginia 2025 Regular Session)
INFO - [base] obj1 sources: ["[https://lis.virginia.gov/vote-details/[{'VoteLegislationID':](https://lis.virginia.gov/vote-details/[%7B'VoteLegislationID':) 306230, 'LegislationID': 92156, 'LegislationNumber': 'HB582', 'Description': 'Public high schools; each school board to employ at least one career coach.                         ', 'VoteNumber': None, 'VoteItems': []}]/20251/H092024-01-311"]
INFO - [base] obj2 sources: ["[https://lis.virginia.gov/vote-details/[{'VoteLegislationID':](https://lis.virginia.gov/vote-details/[%7B'VoteLegislationID':) 306230, 'LegislationID': 92156, 'LegislationNumber': 'HB582', 'Description': 'Public high schools; each school board to employ at least one career coach.                         ', 'VoteNumber': None, 'VoteItems': []}]/20251/H092024-01-311"]

Looks like dedupe key used was not actually unique. Also fixes URL used as sources for votes.

@jessemortenson jessemortenson merged commit 33d7af7 into main Nov 5, 2024
2 checks passed
@jessemortenson
Copy link
Contributor Author

FYI @showerst - just in case I missed something in changing the logic around dedupe key or source here on Vote Events

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