alexreisner/geocoder

Redis depcrecation warning filling up testing logs

Closed this issue · 4 comments

Everytime I run Rspec tests the logs are filled with these deprecation warnings that seems to point to Geocoder.

Passing '[]' command to redis as is; blind passthrough has been deprecated and will be removed in redis-namespace 2.0 (at .rvm/gems/ruby-3.1.4@soothe/gems/geocoder-1.8.2/lib/geocoder/cache_stores/generic.rb:19:in `read')

Passing '[]=' command to redis as is; blind passthrough has been deprecated and will be removed in redis-namespace 2.0 (at .rvm/gems/ruby-3.1.4@soothe/gems/geocoder-1.8.2/lib/geocoder/cache_stores/generic.rb:8:in `write')

Technically doesnt break antyhing just makes it harder to follow what is happening as we have 1000's of these warnings in the testing logs. Any plans to fix this?

Environment info

  • Geocoder version: 1.8.2
  • Rails version: 6.1.6
  • Database (if applicable): MYSQL/Redis

I think this might actually be a problem with the redis-namespace gem, which is not required by Geocoder. Can you try upgrading that gem in your project?

@alexreisner just tried that and still getting the same result. We are using Redis as the cache for Geocoder
the error seems to be directing me to this file that has the [] and []= set whcih seem to be geocoder files
Screen Shot 2024-02-04 at 11 32 34 AM

Totally agree that Geocoder is calling those methods. But they're the correct methods to call. The gem that's actually producing the warning is redis-namespace. My guess is that the cache object you're passing to Geocoder is a Redis::Namespace object. I'm not familiar with that gem, but it looks like using it as a straight substitute for a Redis object is deprecated, and that's why you're getting the warnings. Can you try passing a plain old Redis object and see if that gets rid of the warning?

Yea I Mena looking at it it maybe responding to the [] but isn't in the future but it will respond to the get method. It maybe just something we have to deal with until it is officially deprecated . I remo removed the [] part of the case statement just to test and it still worked so I may have to just wait until namespace gem is actually up to version 2 it's at 1.8 right now. Will close this for now and see what I can do just to remove the messages . Thanks for your time