Skip to content

Commit

Permalink
MT: Fix scraper error on missing EXCUSED vote count key
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemortenson committed Jan 17, 2025
1 parent 1d930b7 commit db313f5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scrapers/mt/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def scrape_votes_page(self, vote_url: str, bill: Bill):
for row in page:
motion = row["motion"]

counts = {"YES": 0, "NO": 0, "ABSENT": 0}
counts = {"YES": 0, "NO": 0, "ABSENT": 0, "EXCUSED": 0}
for v in row["legislatorVotes"]:
vote_type_key = "voteType" if "voteType" in v else "committeeVote"
counts[v[vote_type_key]] += 1
Expand Down Expand Up @@ -518,9 +518,8 @@ def scrape_votes_page(self, vote_url: str, bill: Bill):
classification=[],
)

vote.set_count("yes", counts["YES"])
vote.set_count("no", counts["NO"])
vote.set_count("absent", counts["NO"])
for count_key in counts.keys():
vote.set_count(count_key.lower(), counts[count_key])
vote.add_source(bill.sources[0]["url"])

for v in row["legislatorVotes"]:
Expand Down

0 comments on commit db313f5

Please sign in to comment.