You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 22, 2024. It is now read-only.
I believe I encountered what appears to be a small bug in this package that I cannot get around when trying to incorporate it into my own package which provides a db access layer for our team. Here is what I believe is the problem.
Note that I am using the most recent version from CRAN 0.1.18.3
The PivotalR package implements cbind and therefore overrides the base cbind when the fully library is loaded using the library(PivotalR) directive. From the behavior I have seen it appears that a reference to cbind in your package uses whatever cbind is available in the current environment as opposed to explicitly using PivotalR::cbind. I believe this to be the case as my code works fine when specifying library(PivotalR) but fails during db.disconnect with the following when the library is not fully loaded.
Sample Code
#library(PivotalR)
connect = function(){
PivotalR::db.connect(host='x1', user='x2', password='x3', dbname='x4', quick=TRUE)
}
disconnect = function(id){
PivotalR::db.disconnect(conn.id=id, verbose=TRUE)
}
query = function(str){
id = connect()
result = PivotalR::db.q(str, conn.id=id, verbose=TRUE, nrows='all')
disconnect(id)
result
}
X = query(“SELECT * FROM <table>”)
Error in .localVars$conn.type[[conn.pkg]] <- .localVars$conn.type[[conn.pkg]][-which(.localVars$conn.type[[conn.pkg]] == : replacement has length zero
When the library PivotalR is loaded, I see the following informational messages and my code works without error:
> library("PivotalR", lib.loc="~/R/win-library/3.3")
Attaching package: ‘PivotalR’
The following objects are masked from ‘package:stats’:
sd, var
The following object is masked from ‘package:base’:
cbind
Which is why I believe there is an implicit call to cbind in your code ( It doesn’t seem that sd or var are the issue). Note that the first time it fails in db.disconnect but if you rerun without resetting the environment subsequent calls will fail in db.connect with the following error message:
Error in .localVars$conn.type[["rpostgresql"]] <- c(.localVars$conn.type[["rpostgresql"]], : more elements supplied than there are to replace
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report from Mark Malamut:
I believe I encountered what appears to be a small bug in this package that I cannot get around when trying to incorporate it into my own package which provides a db access layer for our team. Here is what I believe is the problem.
Note that I am using the most recent version from CRAN 0.1.18.3
The PivotalR package implements cbind and therefore overrides the base
cbind
when the fully library is loaded using thelibrary(PivotalR)
directive. From the behavior I have seen it appears that a reference tocbind
in your package uses whatevercbind
is available in the current environment as opposed to explicitly usingPivotalR::cbind
. I believe this to be the case as my code works fine when specifyinglibrary(PivotalR)
but fails duringdb.disconnect
with the following when the library is not fully loaded.Sample Code
Which is why I believe there is an implicit call to cbind in your code ( It doesn’t seem that sd or var are the issue). Note that the first time it fails in db.disconnect but if you rerun without resetting the environment subsequent calls will fail in db.connect with the following error message:
The text was updated successfully, but these errors were encountered: