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

MT: fix for vote pointing to bad action id #5227

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions scrapers/mt/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def scrape_votes_page(self, vote_url: str, bill: Bill):
passed = counts["YES"] > counts["NO"]

# regular vs committee votes
if "billStatus" in row:
if "billStatus" in row and row["billStatus"] and "id" in row["billStatus"]:
bill_action = self.actions_by_id[str(row["billStatus"]["id"])]
chamber = (
"lower"
Expand All @@ -490,8 +490,19 @@ def scrape_votes_page(self, vote_url: str, bill: Bill):
== "HOUSE"
else "upper"
)
bill_action = self.actions_by_id[str(row["billStatusId"])]
if str(row["billStatusId"]) in self.actions_by_id:
bill_action = self.actions_by_id[str(row["billStatusId"])]
else:
self.warning(
f"Unable to find bill action {str(row['billStatusId'])}"
)
bill_action = None
when = dateutil.parser.parse(row["voteTime"])
else:
self.error(
f"Found MT vote with neither an action nor a meeting. {vote_url}"
)
continue

when = self.tz.localize(when)
vote_id = f"{bill.legislative_session}-{bill.identifier}-{str(row['id'])}"
Expand Down
Loading