Closed peterhurford closed 7 years ago
@russellpierce
foo.yml
name: RSQLite
version: 2.0
load: false
in R:
kk <- yaml::yaml.load_file('foo.yml')
kk$version %>% as.character
kk
# $name
# [1] "RSQLite"
#
# $version
# [1] 2
#
# $load
# [1] FALSE
kk$version %>% as.character
# [1] "2"
@kirillseva I see what you mean about how 1.0
gets turned into "1"
...
@kirillseva Looks like a custom float handler solves the issue!
Please test this more :)
I like the tests and the improved modularity of this pull-request, but I feel like introducing custom yaml loading rules and casting everything as characters, including booleans, is overengineering the problem and makes debugging future issues more complicated.
Especially when the solution to the problem is using a couple of quotes here and there
I like the idea that this would make the lockfile just work and hide the complexity from the user.
What if someone decides to version their package just by integers with no decimal, would this still work?
What gets me with 119 is that it is just detecting the existing version that fails and triggers a reinstall. Lockbox then goes on to load things just fine.
If a solution like this isn't accepted, could we find a middle ground with an informative warning when the version specified risks running into this issue?
Or we can update the readme so that all examples show version listed in quotes and avoid overengineering On Sun, Aug 20, 2017 at 3:11 PM Russell S. Pierce notifications@github.com wrote:
I like the idea that this would make the lockfile just work and hide the complexity from the user.
What if someone decides to version their package just by integers with no decimal, would this still work?
What gets me with 119 is that it is just detecting the existing version that fails and triggers a reinstall. Lockbox then goes on to load things just fine.
If a solution like this isn't accepted, could we find a middle ground with an informative warning when the version specified risks running into this issue?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robertzk/lockbox/pull/120#issuecomment-323605227, or mute the thread https://github.com/notifications/unsubscribe-auth/AEO9uLsUM4WYCakVzQ_D_UCPWC46kAY1ks5saITOgaJpZM4O8biA .
I like the idea that this would make the lockfile just work and hide the complexity from the user.
is overengineering the problem and makes debugging future issues more complicated
It's definitely a trade-off. I'm open for a vote on this.
~
I like the tests and the improved modularity of this pull-request
Either way, I do think we should keep that. I can resubmit the PR if desired.
~
casting everything as characters, including booleans
Good catch. I fixed that so that booleans stay as booleans. I added test coverage for that too.
And thanks for catching the embarrassing sprintf("%.1f", 1.0)
fix. ...This is why I made quickcheck for R. ...I added some more tests around that.
~
What if someone decides to version their package just by integers with no decimal, would this still work?
Yes.
Vote: Yes
The PR is well compartmentalized and tested. For now it solves a problem that affects the usability of the package. I grant that the PR represents extra complexity. However, there is nothing to say we can't revert that complexity down the line if it becomes a problem. In the near term I don't see much reason to shy away from it.
At the very least, let's get the passing tests merged - then we can leave updating the docs or adding a warning to another PR.
Oh tests are here to stay, I'm not letting them go :) but I am of an opinion that we do not need any extra magical typecasting under the hood On Tue, Aug 22, 2017 at 2:45 PM Russell S. Pierce notifications@github.com wrote:
Vote: Yes
The PR is well compartmentalized and tested. For now it solves a problem that affects the usability of the package. I grant that the PR represents extra complexity. However, there is nothing to say we can't revert that complexity down the line if it becomes a problem. In the near term I don't see much reason to shy away from it.
At the very least, let's get the passing tests merged - then we can leave updating the docs or adding a warning to another PR.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robertzk/lockbox/pull/120#issuecomment-324131760, or mute the thread https://github.com/notifications/unsubscribe-auth/AEO9uFAtUdw7WpJw1kkyGlnvJxJ1-A6dks5say_vgaJpZM4O8biA .
Here's how I would deal with this situation if it were kirillseva/lockbox
:)
But that's just like my opinion, we're all obviously waiting on @robertzk's thoughts on this matter
@kirillseva I'm happy to let @robertzk decide. I can assist with making a new PR with the tests + refactor if @robertzk decides to go off of #121 instead of #120.
Either @robertzk merged https://github.com/robertzk/lockbox/pull/121 without thinking of this PR or he has voted against the custom character parsing. @robertzk can you weigh in explicitly?
@robertzk ping
@peterhurford Ping!
@peterhurford It looks like the float handler wasn't doing as much as expected. (Putting a stop
in the is.numeric(x)
branch showed it doesn't execute at all during tests.) I'll merge when green.
@robertzk Thanks for finishing this up!
@robertzk @kirillseva Should we revert https://github.com/robertzk/lockbox/pull/121 in light of this PR merge?
@peterhurford Good point!
Resolves https://github.com/robertzk/lockbox/issues/119