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 defunct error message bug #1310

Merged
merged 2 commits into from Aug 27, 2020
Merged

Conversation

malcolmbarrett
Copy link
Contributor

@malcolmbarrett malcolmbarrett commented Aug 26, 2020

Summary

When functions marked defunct using drake_defunct include drake::, the call -> string conversion results in a mangled message

drake::analyses()
#> Error: function ::() in drake is defunct.function drake() in drake is defunct.function analyses() in drake is defunct.

Created on 2020-08-26 by the reprex package (v0.3.0)

  • This PR deparses match.call() prior to pasting. (rlang can also do this but I chose deparse() because there seems to be some discussion about long-term deprecation of quo_text() and cousins in favor of a different approach, and this struck me as too simple a problem to deal with it.)
  • I also added a test for this bug.

With the PR, the output is now correct:

drake::analyses()
#> Error: function drake::analyses() in drake is defunct.

Created on 2020-08-26 by the reprex package (v0.3.0)

Checklist

@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2020

Codecov Report

Merging #1310 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1310   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           51        51           
  Lines         8324      8327    +3     
=========================================
+ Hits          8324      8327    +3     
Impacted Files Coverage Δ
R/defunct.R 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5c21fc...bf74741. Read the comment docs.

Copy link
Collaborator

@wlandau wlandau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this, @malcolmbarrett! Would you use drake's safe_deparse() instead of base::deparse() and mention your patch in NEWS.md?

@malcolmbarrett
Copy link
Contributor Author

Ah, I should have known that drake would have an opinion on deparsing! Done.

@wlandau
Copy link
Collaborator

wlandau commented Aug 27, 2020

Thanks!

Don’t worry about the GitHub Actions errors, those are transient and unrelated.

@wlandau wlandau merged commit 1660cd3 into ropensci:master Aug 27, 2020
@malcolmbarrett malcolmbarrett deleted the deparse_defunct branch August 27, 2020 17:30
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

3 participants