ANSWER: What you need to consider is if the legislator is coming 1) as a candidate; 2) as a public figure; or 3) on his/her own at a public event. National PTA has a lot of information to help you determine the correct action. In particular check out the Candidate Appearances link.
1) If they are coming as a candidate you need to make sure that any opponents have an equal opportunity. Invite all candidates in the same race. They don’t all have to come but they all must be invited. You may want to organize a candidate forum to help your community with the upcoming elections.
2) If they are coming as a public figure they are coming to speak on a particular topic of interest to your community. If they are also running for election then you should have clear expectations that you share with the legislator to make sure they understand PTA’s nonpartisan rules. They should not mention their candidacy.
3) If they come to a public event make sure there is no actual or implied endorsement.