Skip to content

Commit

Permalink
Merge pull request #5253 from openstates/va-bills-bugfix-empty-action…
Browse files Browse the repository at this point in the history
…-desc

Va bills bugfix empty action desc
  • Loading branch information
jessemortenson authored Jan 24, 2025
2 parents 96e2913 + 62a7dc4 commit 5dbd9e8
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions scrapers/va/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,24 @@ def add_actions(self, bill: Bill, legislation_id: str):

for row in page["LegislationEvents"]:
when = dateutil.parser.parse(row["EventDate"]).date()
action_attr = self.categorizer.categorize(row["Description"])
classification = action_attr["classification"]
description = row["Description"]
if not description and row["VoteTally"]:
description = f"Vote {row['VoteTally']}"

bill.add_action(
chamber=self.chamber_map[row["ChamberCode"]],
description=row["Description"],
date=when,
classification=classification,
)
if description:
action_attr = self.categorizer.categorize(description)
classification = action_attr["classification"]

bill.add_action(
chamber=self.chamber_map[row["ChamberCode"]],
description=description,
date=when,
classification=classification,
)
else:
self.logger.warning(
f"Could not add action due to missing description for {bill.identifier} LegislataionEventID {row['LegislationEventID']}"
)

# map reference numbers back to their actions for impact filenames
# HB9F122.PDF > { 'HB9F122' => "Impact statement from DPB (HB9)" }
Expand Down

0 comments on commit 5dbd9e8

Please sign in to comment.