opencivicdata / python-legistar-scraper

Scrapes municipal data from Legistar websites
BSD 3-Clause "New" or "Revised" License
42 stars 28 forks source link

Revise bill relations filter #112

Closed hancush closed 3 years ago

hancush commented 3 years ago

Description

In https://github.com/opencivicdata/python-legistar-scraper/pull/47, we assumed that current relations would share the highest flag value. Per https://github.com/datamade/la-metro-councilmatic/issues/669#issuecomment-747510304, this is not the case. This PR updates the relations method to return a deduplicated list of relations use the most recent version of each relation, rather than a deduplicated list of relations sharing the max value of the relation flag across the entire set. It also exposes a method that can be overridden in downstream scraper instances to customize how, if at all, relations should be filtered during a scrape.

Connects https://github.com/datamade/la-metro-councilmatic/issues/669.

Notes

We aren't 100% sure how the relation flag value is set (Metro is looking into it), but we do know that it isn't necessarily meaningful across all relations, only within versions of the same related bill.

Testing instructions