-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 a deprecation warning in unique_generator.rb related to the kwargs change in Ruby 2.7. #1868
Fix a deprecation warning in unique_generator.rb related to the kwargs change in Ruby 2.7. #1868
Conversation
This is failing because it lacks the fixes from #1867, so I'll need to rebase it once that's merged. |
2f1c38c
to
c491b8f
Compare
Actually, I think this passes the arguments to the deprecated positional arguments. Don't merge this yet. |
This was only passing the test suite because of the backwards compatible positional args that most Faker methods have. We need to explicitly pass keyword args, separately from 'normal' args.
Hmm, I'm not sure what the correct way to fix this is :/ I'd rather avoid using |
It works now. But at what cost?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
…s change in Ruby 2.7. (faker-ruby#1868) * Fix a deprecation warning related to the kwargs change in Ruby 2.7. * Try a different approach for fixing the deprecation. * Actually fix deprecation warning. This was only passing the test suite because of the backwards compatible positional args that most Faker methods have. We need to explicitly pass keyword args, separately from 'normal' args. * I give up. ruby2_keywords it is.
…s change in Ruby 2.7. (faker-ruby#1868) * Fix a deprecation warning related to the kwargs change in Ruby 2.7. * Try a different approach for fixing the deprecation. * Actually fix deprecation warning. This was only passing the test suite because of the backwards compatible positional args that most Faker methods have. We need to explicitly pass keyword args, separately from 'normal' args. * I give up. ruby2_keywords it is.
This fixes a deprecation warning I was seeing when using
Faker.unique
:It also removes ~6000 lines of deprecation warnings from the Faker test suite on Ruby 2.7. (There are still >250k others 😉)
See this post for more info: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/