-
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
Deprecation warnings coming from within the library #1655
Comments
Possibly related to #1610 "Faker Deprecation Warnings showing up in Rails Console" ? |
This issue will be fixed in v2. Thanks for reporting. |
This is a little bit frustrating to see happen. I went searching for where I was possibly using Faker incorrectly, but it seems like you are warning yourselves? I can't see some actual CI output currently because I have 100+ lines of these deprecations. Can this be turned off through a flag? When is v2 releasing if not? Thanks for our work on the library! Use it all the time. |
@rylanb sorry about that! We'll remove all the deprecation warnings in v2. I can commit myself to get the pending things done this weekend and publish v2. |
@vbrazo oh no worries. In the grand scheme of things, not a big deal. I was more concerned that it would be months before a v2 might come out. If its a couple weeks, not a big deal. Thanks for responding! |
Is the solution for now just to wait, or is there a change that should be made if you're using the decimal method? |
@connorshea probably the easiest solution for now is to jump back before the deprecation was added ( |
For now I'm just going to hack around it since I only have one call to the # Before
Faker::Number.decimal(3, 1)
# After
"#{rand(999)}.#{rand(10)}".to_f Hopefully that's useful to someone while we wait :P |
@connorshea it's going to be fixed in this PR #1651. The change is here. |
Please feel free to review this PR. I need some eyes on it @rylanb @connorshea @nathanhinchey |
@vbrazo I tried to review it but the context is beyond me. I think @nathanhinchey got you covered though! |
@rylanb yeah! He did a good job. I still need to read that PR again and apply any necessary changes. I think we're getting pretty close. |
Describe the bug
In version
1.9.6
callingNumer::decimal
results in deprecation warnings, becauseNumber::decimal
usesNumber::decimal_part
.Additionally, there is a bug in the deprecation warning where it is suggesting an empty string as a replacement. (Same steps to reproduce)
To Reproduce
Use
Number::decimal
anywhere. I found it usingrake test
, but the easiest repro is with an interactive ruby terminal, e.g. in pry:Expected behavior
There should not be a deprecation warning for code that is not deprecated. Non-deprecated code should not call deprecated code.
Additionally, the deprecation warning should suggest an alternative instead of an empty string.
The text was updated successfully, but these errors were encountered: