From 1d6415022b02a8e9418989709b6c4710135912c8 Mon Sep 17 00:00:00 2001 From: Maxime Petazzoni Date: Tue, 4 Nov 2025 15:00:43 -0800 Subject: [PATCH 1/3] feat: expose force_new --- README.md | 4 ++++ wherobots/db/driver.py | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d91d8c5..edcafa2 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,10 @@ users may find useful: Consider multi-session for potential cost savings, but be mindful of performance impacts from shared resources. You might need to adjust cluster size if slowdowns occur, which could affect overall cost. +* `force_new`: passing `force_new=True` forces Wherobots Cloud to create + and start a new SQL Session runtime for this connection instead of + attempting to reuse an existing, available one. Note that this can + severely impact the delay in obtaining a connection to your runtime. * `shutdown_after_inactive_seconds`: how long the runtime waits and stays running after all clients have disconnected. This delay gives an opportunity for clients to reconnect to a previously-established diff --git a/wherobots/db/driver.py b/wherobots/db/driver.py index 4482e9c..ef26191 100644 --- a/wherobots/db/driver.py +++ b/wherobots/db/driver.py @@ -68,6 +68,7 @@ def connect( wait_timeout: float = DEFAULT_SESSION_WAIT_TIMEOUT_SECONDS, read_timeout: float = DEFAULT_READ_TIMEOUT_SECONDS, session_type: Union[SessionType, None] = None, + force_new: bool = False, shutdown_after_inactive_seconds: Union[int, None] = None, results_format: Union[ResultsFormat, None] = None, data_compression: Union[DataCompression, None] = None, @@ -91,7 +92,8 @@ def connect( session_type = session_type or DEFAULT_SESSION_TYPE logging.info( - "Requesting %s runtime running %s in %s from %s ...", + "Requesting %s%s runtime running %s in %s from %s ...", + "new " if force_new else "", runtime.value, version, region.value, @@ -105,7 +107,7 @@ def connect( try: resp = requests.post( url=f"{host}/sql/session", - params={"region": region.value}, + params={"region": region.value, "force_new": force_new}, json={ "runtimeId": runtime.value, "shutdownAfterInactiveSeconds": shutdown_after_inactive_seconds, From 1d9f4dc8710abec893babc447f23e56f6a94ef2f Mon Sep 17 00:00:00 2001 From: Maxime Petazzoni Date: Tue, 4 Nov 2025 15:17:00 -0800 Subject: [PATCH 2/3] feat: define micro-a10-gpu runtime --- wherobots/db/runtime.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wherobots/db/runtime.py b/wherobots/db/runtime.py index 7458666..c45d18a 100644 --- a/wherobots/db/runtime.py +++ b/wherobots/db/runtime.py @@ -19,6 +19,7 @@ class Runtime(Enum): XXXX_LARGE_HIMEM = "4x-large-himem" # GPU + MICRO_A10_GPU = "micro-a10-gpu" TINY_A10_GPU = "tiny-a10-gpu" SMALL_A10_GPU = "small-a10-gpu" MEDIUM_A10_GPU = "medium-a10-gpu" From 37e79f4a0b9b4cc4fd503e19ec514f3ce3f9858a Mon Sep 17 00:00:00 2001 From: Maxime Petazzoni Date: Tue, 4 Nov 2025 16:43:11 -0800 Subject: [PATCH 3/3] chore: 0.21.0 release --- pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fc98594..54201ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "wherobots-python-dbapi" -version = "0.20.0" +version = "0.21.0" description = "Python DB-API driver for Wherobots DB" authors = [{ name = "Maxime Petazzoni", email = "max@wherobots.com" }] requires-python = ">=3.8, <4" diff --git a/uv.lock b/uv.lock index 1d73065..8eb878c 100644 --- a/uv.lock +++ b/uv.lock @@ -1593,7 +1593,7 @@ wheels = [ [[package]] name = "wherobots-python-dbapi" -version = "0.20.0" +version = "0.21.0" source = { editable = "." } dependencies = [ { name = "cbor2" },