@@ -32,7 +32,11 @@ class DSConnection:
3232 """
3333 Connection class to a DataSHIELD server.
3434 """
35-
35+
36+ #
37+ # Content listing
38+ #
39+
3640 def list_tables (self ) -> list :
3741 """
3842 List available table names from the data repository.
@@ -61,9 +65,13 @@ def has_resource(self, name: str) -> bool:
6165 """
6266 raise NotImplementedError ("DSConnection function not available" )
6367
68+ #
69+ # Assign
70+ #
71+
6472 def assign_table (self , symbol : str , table : str , variables : list = None ,
6573 missings : bool = False , identifiers : str = None ,
66- id_name : str = None , asynchronous : bool = True ) -> None :
74+ id_name : str = None , asynchronous : bool = True ) -> DSResult :
6775 """
6876 Assign a data table from the data repository to a symbol in the DataSHIELD R session.
6977
@@ -73,7 +81,7 @@ def assign_table(self, symbol: str, table: str, variables: list = None,
7381 """
7482 raise NotImplementedError ("DSConnection function not available" )
7583
76- def assign_resource (self , symbol : str , resource : str , asynchronous : bool = True ) -> None :
84+ def assign_resource (self , symbol : str , resource : str , asynchronous : bool = True ) -> DSResult :
7785 """
7886 Assign a resource from the data repository to a symbol in the DataSHIELD R session.
7987
@@ -83,7 +91,7 @@ def assign_resource(self, symbol: str, resource: str, asynchronous: bool = True)
8391 """
8492 raise NotImplementedError ("DSConnection function not available" )
8593
86- def assign_expr (self , symbol : str , expr : str , asynchronous : bool = True ) -> None :
94+ def assign_expr (self , symbol : str , expr : str , asynchronous : bool = True ) -> DSResult :
8795 """
8896 Assign the result of the evaluation of an expression to a symbol in the DataSHIELD R session.
8997
@@ -93,6 +101,10 @@ def assign_expr(self, symbol: str, expr: str, asynchronous: bool = True) -> None
93101 """
94102 raise NotImplementedError ("DSConnection function not available" )
95103
104+ #
105+ # Aggregate
106+ #
107+
96108 def aggregate (self , expr : str , asynchronous : bool = True ) -> DSResult :
97109 """
98110 Aggregate some data from the DataSHIELD R session using a valid R expression. The
@@ -103,6 +115,10 @@ def aggregate(self, expr: str, asynchronous: bool = True) -> DSResult:
103115 """
104116 raise NotImplementedError ("DSConnection function not available" )
105117
118+ #
119+ # Symbols
120+ #
121+
106122 def list_symbols (self ) -> list :
107123 """
108124 After assignments have been performed, some symbols live in the DataSHIELD R session on the server side.
@@ -116,7 +132,11 @@ def rm_symbol(self, name: str) -> None:
116132 :param name: The name of symbol to remove
117133 """
118134 raise NotImplementedError ("DSConnection function not available" )
119-
135+
136+ #
137+ # DataSHIELD config
138+ #
139+
120140 def list_profiles (self ) -> list :
121141 """
122142 List available DataSHIELD profile names in the data repository.
@@ -136,7 +156,11 @@ def list_packages(self) -> list:
136156 Get the list of DataSHIELD packages with their version, that have been configured on the remote data repository.
137157 """
138158 raise NotImplementedError ("DSConnection function not available" )
139-
159+
160+ #
161+ # Workspaces
162+ #
163+
140164 def list_workspaces (self ) -> list :
141165 """
142166 Get the list of DataSHIELD workspaces, that have been saved on the remote data repository.
@@ -169,7 +193,11 @@ def rm_workspace(self, name: str) -> list:
169193 """
170194 raise NotImplementedError ("DSConnection function not available" )
171195
172- def is_async (self ) -> bool :
196+ #
197+ # Utils
198+ #
199+
200+ def is_async (self ) -> dict :
173201 """
174202 When a DSResult object is returned on aggregation or assignment operation,
175203 the raw result can be accessed asynchronously, allowing parallelization of DataSHIELD calls
@@ -179,7 +207,7 @@ def is_async(self) -> bool:
179207 """
180208 raise NotImplementedError ("DSConnection function not available" )
181209
182- def keep_alive (self ) -> bool :
210+ def keep_alive (self ) -> None :
183211 """
184212 As the DataSHIELD sessions are working in parallel, this function helps at keeping
185213 idle connections alive while others are working. Any communication failure must
@@ -200,12 +228,13 @@ class DSDriver:
200228 """
201229
202230 @classmethod
203- def new_connection (cls , name : str , args : dict , restore : str = None ) -> DSConnection :
231+ def new_connection (cls , name : str , args : dict , profile : str = "default" , restore : str = None ) -> DSConnection :
204232 """
205233 Creates a new connection
206234
207235 :param name: The DataSHIELD server name
208236 :param args: The connection arguments, as a dictionary
237+ :param profile: The DataSHIELD profile name to be used
209238 :param restore: The workspace name to be restored
210239 """
211240 raise NotImplementedError ("DSConnection function not available" )
0 commit comments