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

Fix more ruby 2.7 keyword params deprecation warnings #728

Merged
merged 1 commit into from
Jan 14, 2021
Merged

Fix more ruby 2.7 keyword params deprecation warnings #728

merged 1 commit into from
Jan 14, 2021

Conversation

aglushkov
Copy link
Contributor

Fixes deprecation warnings

warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
  1. Fixed warning when calling response.records, warning backtrace:
     # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/loader.rb:55:in `block in load'
     # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/loader.rb:50:in `each'
     # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/loader.rb:50:in `each_with_object'
     # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/loader.rb:50:in `load'
     # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/response.rb:85:in `objects'
  1. Fixed warning when calling SomeIndex.reset!((Time.now.to_f * 1000).round), warning backtrace:
     # gems/chewy-74470f2525b2/lib/chewy/type/adapter/active_record.rb:25:in `import_scope'
     # gems/chewy-74470f2525b2/lib/chewy/type/adapter/orm.rb:79:in `import'
     # gems/chewy-74470f2525b2/lib/chewy/type/import.rb:142:in `block in import_linear'
     # /home/aglushkov/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'
     # /home/aglushkov/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
     # /home/aglushkov/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'
     # gems/chewy-74470f2525b2/lib/chewy/type/import.rb:141:in `import_linear'
     # gems/chewy-74470f2525b2/lib/chewy/type/import.rb:136:in `import_routine'
     # gems/chewy-74470f2525b2/lib/chewy/type/import.rb:76:in `import'
     # gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:149:in `block in import'
     # gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:147:in `map'
     # gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:147:in `import'
     # gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:182:in `reset!'
  1. Same SomeIndex.reset!((Time.now.to_f * 1000).round), warning backtrace:
# gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/type/import.rb:130:in `new'
# gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/type/import.rb:130:in `import_routine'
# gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/type/import.rb:76:in `import'
# gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:149:in `block in import'
# gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:147:in `map'
# gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:147:in `import'
# gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:182:in `reset!'

Fixes deprecation warnings
```
warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
```

1. Fixed warning when calling `response.records`, warning backtrace:
```
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/loader.rb:55:in `block in load'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/loader.rb:50:in `each'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/loader.rb:50:in `each_with_object'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/loader.rb:50:in `load'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/search/response.rb:85:in `objects'
```

2. Fixed warning when calling `SomeIndex.reset!((Time.now.to_f * 1000).round)`, warning backtrace:
```
  # gems/chewy-74470f2525b2/lib/chewy/type/adapter/active_record.rb:25:in `import_scope'
  # gems/chewy-74470f2525b2/lib/chewy/type/adapter/orm.rb:79:in `import'
  # gems/chewy-74470f2525b2/lib/chewy/type/import.rb:142:in `block in import_linear'
  # /home/aglushkov/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'
  # /home/aglushkov/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
  # /home/aglushkov/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'
  # gems/chewy-74470f2525b2/lib/chewy/type/import.rb:141:in `import_linear'
  # gems/chewy-74470f2525b2/lib/chewy/type/import.rb:136:in `import_routine'
  # gems/chewy-74470f2525b2/lib/chewy/type/import.rb:76:in `import'
  # gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:149:in `block in import'
  # gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:147:in `map'
  # gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:147:in `import'
  # gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:182:in `reset!'
```

3. Same  `SomeIndex.reset!((Time.now.to_f * 1000).round)`, warning backtrace:
```
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/type/import.rb:130:in `new'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/type/import.rb:130:in `import_routine'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/type/import.rb:76:in `import'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:149:in `block in import'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:147:in `map'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:147:in `import'
  # gems/2.7.0/bundler/gems/chewy-74470f2525b2/lib/chewy/index/actions.rb:182:in `reset!'
```
@bbatsov bbatsov merged commit 0e6f609 into toptal:master Jan 14, 2021
@bbatsov
Copy link
Member

bbatsov commented Jan 14, 2021

Thanks!

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.

2 participants