Repository navigation
Avoid warning with connection observer callback conditions eval - #494
Merged
Merged
Conversation
When called using something like:
```
odbc::dbConnect(odbc::odbc(), "DSN")
```
`as.character(expr[[1]])` will print something like `[1] odbc :: dbConnect` which evaluate to FALSE FALSE FALSE and cause a warning similar to
```
warning messages from top-level task callback '1'
Warning message:
In is.call(expr) && as.character(expr[[1]]) %in% c("<-", "=") :
'length(x) = 3 > 1' in coercion to 'logical(1)'
```
|
Not sure what it would take to get this reviewed and approved? |
Collaborator
|
Hi - Thanks for the submission. Tailing could work. Alternatively, rather than converting the expression to character, it may be better converting the assignment operators to expressions. Something like: Please also add a bullet in the NEWS markdown file highlighting the fix. Thanks again |
added 2 commits
November 8, 2022 07:53
detule
approved these changes
Nov 8, 2022
hadley
reviewed
Nov 8, 2022
hadley
reviewed
Nov 8, 2022
Collaborator
|
Thanks again!🏆 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In R 4.2.0, when dbConnect is called within RStudio using something like:
In
odbc/R/Driver.R
Line 123 in dee7ae0
as.character(expr[[1]])will have values[1] odbc :: dbConnectand condition evaluates toFALSE FALSE FALSEthus cause a warning similar toI suggest using tail with a single element to return the expr name to the right if the
::.