Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add **kwargs to dynamic redis client method definition #6249

Merged

Conversation

IvanTakarlikov-st
Copy link
Contributor

This will allow to avoid Ruby deprecation warnings on Ruby 2.7

gems/sidekiq-7.2.2/lib/sidekiq/redis_client_adapter.rb:36: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
gems/redis-client-0.21.1/lib/redis_client.rb:275: warning: The called method `call' is defined here

Testing env:

Warning[:deprecated] = true
def call(*command, **kwargs)
  puts command, kwargs
end

def wcall(*args); call(*args);end

def wcall2(*args, **kwargs); call(*args, **kwargs);end

Testing:

irb(main):019:0> wcall(1,2,3, foo: 'bar')
(irb):15: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
(irb):12: warning: The called method `call' is defined here
1
2
3
{:foo=>"bar"}
=> nil
irb(main):020:0> wcall2(1,2,3, foo: 'bar')
1
2
3
{:foo=>"bar"}
=> nil

@IvanTakarlikov-st
Copy link
Contributor Author

Same with #6136

@mperham
Copy link
Collaborator

mperham commented Apr 10, 2024

Thanks for showing me that redis-client does support keyword args! Happy to see it.

@mperham mperham merged commit 79d254d into sidekiq:main Apr 10, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants