Skip to content

add exception for handling vacant committee members#399

Merged
derekeder merged 2 commits intomasterfrom
dwe/chicago-vacant-committee
Nov 21, 2025
Merged

add exception for handling vacant committee members#399
derekeder merged 2 commits intomasterfrom
dwe/chicago-vacant-committee

Conversation

@derekeder
Copy link
Contributor

Chicago: handling case where committee member is vacant, logging if there is a KeyError otherwise

@derekeder derekeder requested a review from hancush November 21, 2025 20:33
Copy link
Collaborator

@hancush hancush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two little things, then this is good to go.

Comment on lines +142 to +149
person.add_membership(
org,
role=term["memberType"],
start_date=datetime.datetime.fromisoformat(
term["startDate"]
).date(),
end_date=datetime.datetime.fromisoformat(term["endDate"]).date(),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to add this to an else block? I like to limit the code in the try block to what could potentially fail, for the sake of being explicit.

Comment on lines +154 to +155
print("Problem adding to Committee:")
print(error)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably use logging.warning – has the benefit of slotting into existing logging seamlessly and if we want to wire up Sentry in the future, we can use the logging integration without having to change these print statements.

@derekeder derekeder merged commit c06805a into master Nov 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants