File tree 4 files changed +15
-7
lines changed
4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,10 @@ users may find useful:
82
82
convenient for human inspection while still being usable by
83
83
libraries like Shapely.
84
84
* ` session_type ` : ` "single" ` or ` "multi" ` ; if set to ` "single" ` , then each call
85
- to ` Connection. connect()` establishes an exclusive connection to a
86
- Wherobots runtime; if set to "multi", then multiple ` Connection. connect()`
87
- calls with the same arguments and credentials will connect to the same
88
- shared Wherobots runtime; ` "single" ` is the default.
85
+ to ` connect() ` establishes an exclusive connection to a Wherobots runtime;
86
+ if set to "multi", then multiple ` connect() ` calls with the same arguments
87
+ and credentials will connect to the sameshared Wherobots runtime;
88
+ ` "single" ` is the default.
89
89
90
90
Consider multi-session for potential cost savings, but be mindful of
91
91
performance impacts from shared resources. You might need to adjust
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name = "wherobots-python-dbapi"
3
3
4
4
[tool .poetry ]
5
5
name = " wherobots-python-dbapi"
6
- version = " 0.12.0 "
6
+ version = " 0.12.1 "
7
7
description = " Python DB-API driver for Wherobots DB"
8
8
authors = [
" Maxime Petazzoni <[email protected] >" ]
9
9
license = " Apache 2.0"
Original file line number Diff line number Diff line change 11
11
from rich .table import Table
12
12
13
13
from wherobots .db import connect , connect_direct
14
- from wherobots .db .constants import DEFAULT_ENDPOINT
14
+ from wherobots .db .constants import DEFAULT_ENDPOINT , DEFAULT_SESSION_TYPE
15
15
from wherobots .db .connection import Connection
16
16
from wherobots .db .region import Region
17
+ from wherobots .db .session_type import SessionType
17
18
18
19
if __name__ == "__main__" :
19
20
parser = argparse .ArgumentParser ()
20
21
parser .add_argument ("--api-key-file" , help = "File containing the API key" )
21
22
parser .add_argument ("--token-file" , help = "File containing the token" )
22
23
parser .add_argument ("--region" , help = "Region to connect to (ie. aws-us-west-2)" )
24
+ parser .add_argument (
25
+ "--session-type" ,
26
+ help = "Type of session to create. 'single' or 'multi'" ,
27
+ default = DEFAULT_SESSION_TYPE ,
28
+ )
23
29
parser .add_argument (
24
30
"--debug" ,
25
31
help = "Enable debug logging" ,
76
82
shutdown_after_inactive_seconds = args .shutdown_after_inactive_seconds ,
77
83
wait_timeout = 900 ,
78
84
region = Region (args .region ) if args .region else Region .AWS_US_WEST_2 ,
85
+ session_type = SessionType (args .session_type ),
79
86
)
80
87
81
88
def render (results : pandas .DataFrame ) -> None :
Original file line number Diff line number Diff line change @@ -100,10 +100,11 @@ def connect(
100
100
try :
101
101
resp = requests .post (
102
102
url = f"{ host } /sql/session" ,
103
- params = {"region" : region .value , "sessionType" : session_type . value },
103
+ params = {"region" : region .value },
104
104
json = {
105
105
"runtimeId" : runtime .value ,
106
106
"shutdownAfterInactiveSeconds" : shutdown_after_inactive_seconds ,
107
+ "sessionType" : session_type .value ,
107
108
},
108
109
headers = headers ,
109
110
)
You can’t perform that action at this time.
0 commit comments