JuliaWeb/GeoIP.jl

BoundsError() when using city database functions

randyzwitch opened this issue · 1 comments

When I added in the code for all of the city database functions (i.e. all functions beyond original getcountryname and getcountrycode functions), I just copied over the searchsorted logic. But searchsorted requires the underlying array/df to be sorted, correct? If so, the current code for the city functions is incorrect, since when I create the full df on line 102, I do an inner join which doesn't guarantee returning a sorted df.

Luckily, the version that gets installed from METADATA.jl is still the old version, not the updated one, so unless someone clones this repo it shouldn't have affected anyone.

Given the state of flux with DataFrames sorting JuliaData/DataFrames.jl#389, how should I handle this? The reason why I chose to do the join inside the package was so that the MaxMind files could be swapped out as-is, rather than pre-processing them outside the package.

BoundsError()
while loading In[7], in expression starting on line 1
 in getindex at bitarray.jl:363
 in getindex at /Users/randyzwitch/.julia/DataArrays/src/dataarray.jl:311
 in getregionname at /Users/randyzwitch/.julia/GeoIP/src/GeoIP.jl:126

Given PR to re-write whole API, this is well out-of-date