Opened 9 months ago
Closed 9 months ago
#35100 closed Cleanup/optimization (fixed)
Simplify initialization of databases in the GeoIP2 wrapper
Reported by: | Nick Pope | Owned by: | Nick Pope |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Normal | Keywords: | geoip2 |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The initialization of the wrapper around the GeoIP2 databases is overcomplicated and should be simplified.
Currently when calling GeoIP2.city()
and GeoIP2.country()
the city and country databases will be used respectively, but this is unnecessary as the country database is merely a subset of the city database. It should be possible to provide a path and attempt to open a database from three possible candidates: path
, path / city
, and path / country
. While a minor incompatibility in that the city database may be used instead, this also reduces the potential for mixing data from two different databases where one might be outdated.
Change History (6)
comment:1 by , 9 months ago
Has patch: | set |
---|
comment:3 by , 9 months ago
Patch needs improvement: | set |
---|
comment:5 by , 9 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
PR