File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Expand file tree Collapse file tree 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:
8282 convenient for human inspection while still being usable by
8383 libraries like Shapely.
8484* ` 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.
8989
9090 Consider multi-session for potential cost savings, but be mindful of
9191 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"
33
44[tool .poetry ]
55name = " wherobots-python-dbapi"
6- version = " 0.12.0 "
6+ version = " 0.12.1 "
77description = " Python DB-API driver for Wherobots DB"
88authors = [" Maxime Petazzoni <max@wherobots.com>" ]
99license = " Apache 2.0"
Original file line number Diff line number Diff line change 1111from rich .table import Table
1212
1313from 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
1515from wherobots .db .connection import Connection
1616from wherobots .db .region import Region
17+ from wherobots .db .session_type import SessionType
1718
1819if __name__ == "__main__" :
1920 parser = argparse .ArgumentParser ()
2021 parser .add_argument ("--api-key-file" , help = "File containing the API key" )
2122 parser .add_argument ("--token-file" , help = "File containing the token" )
2223 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+ )
2329 parser .add_argument (
2430 "--debug" ,
2531 help = "Enable debug logging" ,
7682 shutdown_after_inactive_seconds = args .shutdown_after_inactive_seconds ,
7783 wait_timeout = 900 ,
7884 region = Region (args .region ) if args .region else Region .AWS_US_WEST_2 ,
85+ session_type = SessionType (args .session_type ),
7986 )
8087
8188 def render (results : pandas .DataFrame ) -> None :
Original file line number Diff line number Diff line change @@ -100,10 +100,11 @@ def connect(
100100 try :
101101 resp = requests .post (
102102 url = f"{ host } /sql/session" ,
103- params = {"region" : region .value , "sessionType" : session_type . value },
103+ params = {"region" : region .value },
104104 json = {
105105 "runtimeId" : runtime .value ,
106106 "shutdownAfterInactiveSeconds" : shutdown_after_inactive_seconds ,
107+ "sessionType" : session_type .value ,
107108 },
108109 headers = headers ,
109110 )
You can’t perform that action at this time.
0 commit comments