Skip to content

Commit

Permalink
Merge pull request #5232 from openstates/al-fix-api-again
Browse files Browse the repository at this point in the history
AL: fix API bug, removing changed/removed properties from GraphQL query
  • Loading branch information
jessemortenson authored Jan 20, 2025
2 parents 363812d + bfa6d59 commit f4b50e8
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions scrapers/al/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ def scrape_bill_type(self, session: str, bill_type: str, offset: int, limit: int
id
sessionYear
instrumentNbr
instrumentSponsor
sponsor
sessionType
body
subject
shortTitle
assignedCommittee
prefiledDate
firstRead
firstReadDate
currentStatus
lastAction
actSummary
Expand All @@ -91,8 +91,7 @@ def scrape_bill_type(self, session: str, bill_type: str, offset: int, limit: int
id
instrumentNbr
instrumentType
instrumentSponsor
instrumentUrl
sponsor
introducedUrl
engrossedUrl
enrolledUrl
Expand Down Expand Up @@ -144,7 +143,7 @@ def scrape_bill_type(self, session: str, bill_type: str, offset: int, limit: int
chamber=chamber,
classification=self.bill_types[row["instrumentType"]],
)
sponsor = row["instrumentSponsor"]
sponsor = row["sponsor"]
if sponsor == "":
self.warning("No sponsors")
continue
Expand All @@ -161,8 +160,9 @@ def scrape_bill_type(self, session: str, bill_type: str, offset: int, limit: int
self.scrape_rest(bill, row)

bill.add_source("https://alison.legislature.state.al.us/bill-search")
if row["instrumentUrl"]:
bill.add_source(row["instrumentUrl"])
# AL removed instrumentUrl from API as of 1/20/25
# if row["instrumentUrl"]:
# bill.add_source(row["instrumentUrl"])

# some subjects are super long & more like abstracts, but it looks like whatever is before a comma or
# semicolon is a clear enough subject. Adds the full given Subject as an Abstract & splits to add that
Expand Down Expand Up @@ -252,8 +252,8 @@ def scrape_rest(self, bill: Bill, bill_row: dict):
committee
nays
yeas
vote
voteNbr
# vote
# voteNbr
amdSub
...rollVoteModalInstrumentHistoryFragment
__typename
Expand All @@ -270,10 +270,10 @@ def scrape_rest(self, bill: Bill, bill_row: dict):
instrumentNbr
sessionYear
sessionType
bir
# bir
calendarDate
matter
roll
# roll
...rollVoteModalBirFragment
__typename
}
Expand All @@ -288,14 +288,14 @@ def scrape_rest(self, bill: Bill, bill_row: dict):
sessionType
calendarDate
body
voteNbr
# voteNbr
}
fragment rollVoteModalBirFragment on BudgetIsolationResolution {
__typename
instrumentNbr
bir
# bir
calendarDate
roll
# roll
}
""",
"variables": {
Expand Down

0 comments on commit f4b50e8

Please sign in to comment.