jupyterlab-contrib / jupyterlab-variableInspector

Variable Inspector extension for Jupyterlab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

R: Incompatibility with DBI::dbConnect

rplati opened this issue · comments

When inspecting an R-kernel, the extension works until I establish a connection to a database with DBI::dbConnect. After that, no newly declared variables will appear in the Variable Inspector. Using JupyterLab 4.0.10, R 4.3.2 and Variable Inspector v3.1.0 on Red Hat Enterprise Linux 9.3, but I’ve noticed the same issue with older versions as well.

# works fine at first
a <- 1

con <- DBI::dbConnect(odbc::odbc(),
                      .connection_string="Driver={ODBC Driver 18 for SQL Server};
                                     Server=<server\\instance>;
                                     Database=<database>;
                                     Integrated_Security=True;
                                     Trusted_Connection=Yes;
                                     TrustServerCertificate=Yes")

# the new variable will not appear after DBI::dbConnect() call
b <- 2

# the issue persists even after DBI::dbDisconnect()
DBI::dbDisconnect(con)
c <- 3