wherobots-python-dbapi 0.5.0__tar.gz → 0.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wherobots-python-dbapi
3
- Version: 0.5.0
3
+ Version: 0.5.2
4
4
  Summary: Python DB-API driver for Wherobots DB
5
5
  License: Apache 2.0
6
6
  Author: Maxime Petazzoni
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "wherobots-python-dbapi"
3
- version = "0.5.0"
3
+ version = "0.5.2"
4
4
  description = "Python DB-API driver for Wherobots DB"
5
5
  authors = ["Maxime Petazzoni <max@wherobots.com>"]
6
6
  license = "Apache 2.0"
@@ -46,6 +46,7 @@ def connect(
46
46
  region: Region = None,
47
47
  wait_timeout: float = DEFAULT_SESSION_WAIT_TIMEOUT_SECONDS,
48
48
  read_timeout: float = DEFAULT_READ_TIMEOUT_SECONDS,
49
+ shutdown_after_inactive_seconds: Union[int, None] = None,
49
50
  results_format: Union[ResultsFormat, None] = None,
50
51
  data_compression: Union[DataCompression, None] = None,
51
52
  geometry_representation: Union[GeometryRepresentation, None] = None,
@@ -61,6 +62,7 @@ def connect(
61
62
  elif api_key:
62
63
  headers["X-API-Key"] = api_key
63
64
 
65
+ host = host or DEFAULT_ENDPOINT
64
66
  runtime = runtime or DEFAULT_RUNTIME
65
67
  region = region or DEFAULT_REGION
66
68
 
@@ -80,7 +82,10 @@ def connect(
80
82
  resp = requests.post(
81
83
  url=f"{host}/sql/session",
82
84
  params={"region": region.value},
83
- json={"runtimeId": runtime.value},
85
+ json={
86
+ "runtimeId": runtime.value,
87
+ "shutdownAfterInactiveSeconds": shutdown_after_inactive_seconds,
88
+ },
84
89
  headers=headers,
85
90
  )
86
91
  resp.raise_for_status()