datamade / bga-payroll

💰 How much do your public officials make?
4 stars 4 forks source link

Correctly filter for salaries in a given year, handles #539 #540

Closed hancush closed 3 years ago

hancush commented 3 years ago

Description

Similarly to #536, this PR addresses a bug that omitted people from indexing if they held their job in a prior year, by selecting people to index based on the vintage of their salary, rather than their job.

Testing instructions

hancush commented 3 years ago

P.s., I also did a quick search of the code base for job__vintage to check for other places where this bug might crop up. No results!

smcalilly commented 3 years ago

P.s., I also did a quick search of the code base for job__vintage to check for other places where this bug might crop up. No results!

was gonna ask if this might happen in the data download we added, but i think this answers that.

hancush commented 3 years ago

Good thought, @smcalilly! You're using the get_salaries method in the export, which helpfully queries Salary directly. One of the handful of good decisions I made, I guess. 😂

https://github.com/datamade/bga-payroll/blob/7880eca4a46b03922fd0f695e993ef1e0613bb7d/payroll/models.py#L184-L195