Skip to content

Bridge SQL connection access between R and Python - #186

Draft
t-kalinowski wants to merge 9 commits into
mainfrom
feat/shared-sql-connection
Draft

t-kalinowski wants to merge 9 commits into
mainfrom
feat/shared-sql-connection

Conversation

@t-kalinowski

@t-kalinowski t-kalinowski commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Allow .console$sql_connection() and _console.sql_connection() to retrieve and select connections owned by either runtime through reticulate. For Python connections, R receives a proxy with the connection's Python methods. For R connections, Python receives an opaque handle it can pass to R functions. R remains the default SQL owner when available.

Connections keep their native APIs and ownership. Getters preserve unread results; selecting a connection discards them without closing the connection or committing its transaction. Reset still restores the managed catalog, and result retrieval still uses the owning runtime.

Internally, a private reticulate callback keeps SQL access independent of a Python variable named r. Update the documentation and model guidance, and add public regressions for connection identity, selection, reset, result lifetime, and transactions.

Transcript collectors preserve the final [done] marker when restart or interrupt output arrives before the submitted cell completes. A gated native R startup regression requires the split replies and verifies exact completion within one response deadline; related restart continuations use the same contract. Runtime behavior and deadlines are unchanged by this fixture repair.

Local macOS validation covers all eight affected public cases (13 executions), the final shared-deadline startup case, and all 23 MCP client self-tests on identical client and collector sources. Formatting and scripts/check passed; the final one-file deadline adjustment was validated by the focused startup case.

Hosted checks for the current test-only repair are pending. The hosted Windows runner does not provide MXC, so native Windows sandbox execution remains unverified.

Apply the existing test-only DuckDB snapshot to direct and MXC SQL
scenarios. Assert the selected version before the long query so cold
caches cannot silently introduce the known Arrow cancellation limitation.
Preserve production defaults, interruption deadlines, and exact results.
Queue stdin while the replacement cell is held at its checkpoint, then
release it and collect the complete result. Preserve the exact output
and idle-state assertions without assuming one response completes the cell.
Keep the required completion marker when a control-and-cell response is
split across polls. Exercise the split with a gated native R startup cell
and select the same contract in related restart continuations.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant