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

Bill relationships resolution improved #128

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

jessemortenson
Copy link
Contributor

I found a couple more problems with related bill resolution:

  • Existing script was using too many DB queries and executed slowly, with lots of DB load (one query per unresolved relationship)
  • Rows are being added to the related bills table that cannot be resolved, because the bill identifier being recorded (for the related bill) is not normalized. So it will never match the identifier of the related bill's record in the bills table.

So, I have made improvements:

  • Uses the bill identifier normalization transformer in add_related_bill() so that we should no longer have un-normalized rows showing up
  • The os-relationships command now by default checks for existing rows that have a common pattern of un-normalized bill identifier strings, and fixes them (which is a fair amount of DB querying, but should be a temporary measure)
  • Improves the main part of os-relationships to query for all the candidates in a few queries, then match against a map of them, instead of query-per-unresolved-relation
  • Adds support to filter by a particular session

@jessemortenson jessemortenson merged commit e81dd61 into main Apr 18, 2024
1 check 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