-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/connection dataset #116
Conversation
* otherwise conn$server doesn't exist
* also update baseline to expect error for bad dataset
Thanks @jefferis , that looks very useful. I'm getting some odd behavior when switching back and forth which I believe might have to do with caching. Let's say I have two connection objects, newConnection <- neuprint_connection()
oldConnection <- neuprint_connection(server="https://emd.../",token = "e...k",config=httr::config(ssl_verifypeer=0L),dataset="hemibrain:vXX")
test2 <- neuprint_queryXXX()
## Results from newConnection
test2 <- neuprint_queryXXX(conn=oldConnection)
## Results from oldConnection
test2 <- neuprint_queryXXX()
## Results from oldConnection
test2 <- neuprint_queryXXX(conn=newConnection)
## Results from newConnection
###### SUPRISING TO ME
test2 <- neuprint_queryXXX()
## Results from oldConnection : it does not switch back to newConnection In other words, the default does not switch more than once, I see the same behavior when trying to switch with neuprint_login. Am I misunderstanding the expected behavior? |
The default is currently to use the last connection added to the connection cache when none is specified. Connections are added to the connection cache when logging in to the server for the first time. Therefore what you see is the expected behaviour right now. To be honest, the only 100% reliable way to deal with two (or more servers) is to make connection objects to both and specify them explicitly for each query.
Anything else relies strongly on the order of operations. You can make the order a bit safer by doing |
Ah yes, that makes sense. It's ready for merge from my perspective (except that |
OK. Thanks @romainFr! Just a note that
|
@romainFr do you want to take a quick look at this? It means that you can specify a default dataset for a connection. I think this will make it easier to use two connections at the same time (e.g. test and public servers). However it also now makes it an error to have a bad dataset specification (rather than just ignoring it).