-
Notifications
You must be signed in to change notification settings - Fork 41
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 bug with raw identifiers in function arguments (#528) #531
Conversation
Hey, thanks for the contribution. There a couple of edge cases we need to cover, but right now I do not have time to comment on this. Can you hold on to this PR for a little bit longer? |
Of course, just let me know. |
Ok so I was thinking about touching this thing: extendr/extendr-api/src/metadata.rs Lines 153 to 159 in 8dc13d8
We have a method that sanitizes rust identifiers on the R side. E.g., if you have a There is another thing, we should also consider a case of functions that have This way we preserve exact 1-to-1 mapping between rust names and R names. |
Added functionality and tests for raw identifiers in function names.
I updated the implementation to incorporate the |
Oh shoot, completely forgot about this, my apologies. I will check it today. |
I think you need to merge master in your branch to update CI |
I don't understand why the Markdown links are causing errors in the tests. This issue was discussed in #534 . I fixed the typos with the parentheses, so not sure what is causing the issue now. |
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.
There are more places where the markdown-links are done incorrectly. But here you go!
Just accept these suggestions.
Co-authored-by: CGMossa <cgmossa@gmail.com>
Co-authored-by: CGMossa <cgmossa@gmail.com>
Co-authored-by: CGMossa <cgmossa@gmail.com>
Geeze! Thanks @CGMossa. |
@bicarlsen Right, you need to run the |
Okay, I was having trouble running the tests on my local machine, but noticed that I had to change the
but am not sure why as I didn't touch that code and it seems unrelated to this PR. |
This happened to me the other day as well...
Run an rextendr colon colon clean() and try again.
…On Thu, 27 Apr 2023, 13.32 bicarlsen, ***@***.***> wrote:
Okay, I was having trouble running the tests on my local machine, but
noticed that I had to change the tests/extendrtests/src/rust/Cargo.toml >
extendr-api
<https://github.com/extendr/extendr/blob/fc677380fa03c638e7913fdd96140da9ff1a5ad4/tests/extendrtests/src/rust/Cargo.toml#L23>
to have an absolute path. I am still receiving an error
── Error ('test-graphic-device.R:2:5'): `my_device()` works as expected ────────
Error in `my_device("foo")`: Graphics API version mismatch
Backtrace:
▆
1. ├─testthat::expect_output(...) at test-graphic-device.R:2:4
2. │ └─testthat:::quasi_capture(...)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─testthat::capture_output_lines(code, print, width = width)
5. │ │ └─testthat:::eval_with_output(code, print = print, width = width)
6. │ │ ├─withr::with_output_sink(path, withVisible(code))
7. │ │ │ └─base::force(code)
8. │ │ └─base::withVisible(code)
9. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
10. └─extendrtests::my_device("foo")
but am not sure why as I didn't touch that code and it seems unrelated to
this PR.
—
Reply to this email directly, view it on GitHub
<#531 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIDVSC7GJ63SZOCFA6WYGDXDJKMXANCNFSM6AAAAAAW7KIGT4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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.
Alright, that part is resolved. Did you have success with running tests after running rextendr::clean()
.
I would say looks good. We have tests to cover these edge cases, everything seems to be in place. Please finalize the change request discussion with @CGMossa and we can proceed. Oh and BTW, please write a note in the changelog. |
After a
|
@Ilia-Kosenkov I browsed the |
When I had this error, I couldn't even do |
Restarted the session a few times, |
Summoning @yutannihilation . You have experience with graphic devices, why are we getting version mismatch here (when executed locally)? Can it be that our bindings are for |
We (are trying to) maintain CHANGELOG according to these rules. In your case, you need to go to the top of the file and add under
Use present tense and simple wording. Give an example of a raw literal (like |
It can happen. But, I guess it's not the case (unless you are using R 4.1). Let me try reproducing it on my local. |
Shall I push wish the new |
Push the changes. Gives us time to review that. |
Okay, I reproduced it. I think you can just remove your |
Yup, that did the trick :) |
Is there anything else to be done here before we can merge? |
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.
LGTM
I had already seen this and thought @Ilia-Kosenkov wanted to give it a last look and then submission. Looks great from my end. |
Added functionality to remove the raw identifier prefix (
r#
) from function arguments in the R bindings.