Skip to content

Commit a4ef05f

Browse files
committed
fix docstrings
1 parent 2fff395 commit a4ef05f

File tree

3 files changed

+50
-50
lines changed

3 files changed

+50
-50
lines changed

dataikuapi/dss/admin.py

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,17 @@ def set_definition(self, definition):
129129
:param dict definition: the definition for the user, as a dict. You should
130130
obtain the definition using get_definition, not create one.
131131
The fields that can be changed are:
132+
132133
* email
134+
133135
* displayName
136+
134137
* groups
138+
135139
* userProfile
140+
136141
* password
142+
137143
"""
138144
return self.client._perform_json(
139145
"PUT", "/admin/users/%s" % self.login,
@@ -226,10 +232,9 @@ def add_impersonation_rule(self, rule, is_user_rule=True):
226232
"""
227233
Add a rule to the impersonation settings
228234
229-
Args:
230-
rule : an impersonation rule, either a :class:`dataikuapi.dss.admin.DSSUserImpersonationRule`
231-
or a :class:`dataikuapi.dss.admin.DSSGroupImpersonationRule`, or a plain dict
232-
is_user_rule : when the rule parameter is a dict, whether the rule is for users or groups
235+
:param rule: an impersonation rule, either a :class:`dataikuapi.dss.admin.DSSUserImpersonationRule`
236+
or a :class:`dataikuapi.dss.admin.DSSGroupImpersonationRule`, or a plain dict
237+
:param is_user_rule: when the rule parameter is a dict, whether the rule is for users or groups
233238
"""
234239
rule_raw = rule
235240
if isinstance(rule, DSSUserImpersonationRule):
@@ -248,15 +253,14 @@ def get_impersonation_rules(self, dss_user=None, dss_group=None, unix_user=None,
248253
"""
249254
Retrieve the user or group impersonation rules that matches the parameters
250255
251-
Args:
252-
dss_user : a DSS user or regular expression to match DSS user names
253-
dss_group : a DSS group or regular expression to match DSS groups
254-
unix_user : a name to match the target UNIX user
255-
hadoop_user : a name to match the target Hadoop user
256-
project_key : a project_key
257-
scope : project-scoped ('PROJECT') or global ('GLOBAL')
258-
type : the rule user or group matching method ('IDENTITY', 'SINGLE_MAPPING', 'REGEXP_RULE')
259-
is_user : True if only user-level rules should be considered, False for only group-level rules, None to consider both
256+
:param dss_user: a DSS user or regular expression to match DSS user names
257+
:param dss_group: a DSS group or regular expression to match DSS groups
258+
:param unix_user: a name to match the target UNIX user
259+
:param hadoop_user: a name to match the target Hadoop user
260+
:param project_key: a project_key
261+
:param scope: project-scoped ('PROJECT') or global ('GLOBAL')
262+
:param type: the rule user or group matching method ('IDENTITY', 'SINGLE_MAPPING', 'REGEXP_RULE')
263+
:param is_user: True if only user-level rules should be considered, False for only group-level rules, None to consider both
260264
"""
261265
user_matches = self.settings['impersonation']['userRules'] if is_user == None or is_user == True else []
262266
if dss_user is not None:
@@ -292,15 +296,14 @@ def remove_impersonation_rules(self, dss_user=None, dss_group=None, unix_user=No
292296
"""
293297
Remove the user or group impersonation rules that matches the parameters from the settings
294298
295-
Args:
296-
dss_user : a DSS user or regular expression to match DSS user names
297-
dss_group : a DSS group or regular expression to match DSS groups
298-
unix_user : a name to match the target UNIX user
299-
hadoop_user : a name to match the target Hadoop user
300-
project_key : a project_key
301-
scope : project-scoped ('PROJECT') or global ('GLOBAL')
302-
type : the rule user or group matching method ('IDENTITY', 'SINGLE_MAPPING', 'REGEXP_RULE')
303-
is_user : True if only user-level rules should be considered, False for only group-level rules, None to consider both
299+
:param dss_user: a DSS user or regular expression to match DSS user names
300+
:param dss_group: a DSS group or regular expression to match DSS groups
301+
:param unix_user: a name to match the target UNIX user
302+
:param hadoop_user: a name to match the target Hadoop user
303+
:param project_key: a project_key
304+
:param scope: project-scoped ('PROJECT') or global ('GLOBAL')
305+
:param type: the rule user or group matching method ('IDENTITY', 'SINGLE_MAPPING', 'REGEXP_RULE')
306+
:param is_user: True if only user-level rules should be considered, False for only group-level rules, None to consider both
304307
"""
305308
for m in self.get_impersonation_rules(dss_user, dss_group, unix_user, hadoop_user, project_key, scope, rule_type, is_user):
306309
if isinstance(m, DSSUserImpersonationRule):

dataikuapi/dss/project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def get_export_stream(self, options = {}):
4646
def export_to_file(self, path, options={}):
4747
"""
4848
Export the project to a file
49-
Args:
50-
path: the path of the file in which the exported project should be saved
49+
50+
:param path: the path of the file in which the exported project should be saved
5151
"""
5252
with open(path, 'wb') as f:
5353
export_stream = self.client._perform_raw(

dataikuapi/dssclient.py

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -320,17 +320,16 @@ def create_connection(self, name, type=None, params=None, usable_by='ALL', allow
320320
321321
Note: this call requires an API key with admin rights
322322
323-
Args:
324-
name: the name of the new connection
325-
type: the type of the new connection
326-
params: the parameters of the new connection, as a JSON object
327-
usable_by: the type of access control for the connection. Either 'ALL' (=no access control)
328-
or 'ALLOWED' (=access restricted to users of a list of groups)
329-
allowed_groups: when using access control (that is, setting usable_by='ALLOWED'), the list
330-
of names of the groups whose users are allowed to use the new connection
331-
332-
Returns:
333-
A :class:`dataikuapi.dss.admin.DSSConnection` connection handle
323+
:param name: the name of the new connection
324+
:param type: the type of the new connection
325+
:param params: the parameters of the new connection, as a JSON object
326+
:param usable_by: the type of access control for the connection. Either 'ALL' (=no access control)
327+
or 'ALLOWED' (=access restricted to users of a list of groups)
328+
:param allowed_groups: when using access control (that is, setting usable_by='ALLOWED'), the list
329+
of names of the groups whose users are allowed to use the new connection
330+
331+
:returns: A :class:`dataikuapi.dss.admin.DSSConnection` connection handle
332+
334333
"""
335334
resp = self._perform_text(
336335
"POST", "/admin/connections/", body={
@@ -380,21 +379,19 @@ def create_meaning(self, id, label, type, description=None,
380379
381380
Note: this call requires an API key with admin rights
382381
383-
Args:
384-
id: the ID of the new meaning
385-
type: the type of the new meaning. Admissible values are 'DECLARATIVE', 'VALUES_LIST', 'VALUES_MAPPING' and 'PATTERN'
386-
description (optional): the description of the new meaning
387-
values (optional): when type is 'VALUES_LIST', the list of values
388-
mappings (optional): when type is 'VALUES_MAPPING', the mapping, as a list of objects with this
389-
structure: {'from': 'value_1', 'to': 'value_a'}
390-
pattern (optional): when type is 'PATTERN', the pattern
391-
normalizationMode (optional): when type is 'VALUES_LIST', 'VALUES_MAPPING' or 'PATTERN', the normalization
392-
mode to use for value matching. One of 'EXACT', 'LOWERCASE', or 'NORMALIZED' (not available
393-
for 'PATTERN' type). Defaults to 'EXACT'.
394-
detectable (optional): whether DSS should consider assigning the meaning to columns set to 'Auto-detect'. Defaults to False.
395-
396-
Returns:
397-
A :class:`dataikuapi.dss.meaning.DSSMeaning` meaning handle
382+
:param id: the ID of the new meaning
383+
:param type: the type of the new meaning. Admissible values are 'DECLARATIVE', 'VALUES_LIST', 'VALUES_MAPPING' and 'PATTERN'
384+
:param description (optional): the description of the new meaning
385+
:param values (optional): when type is 'VALUES_LIST', the list of values
386+
:param mappings (optional): when type is 'VALUES_MAPPING', the mapping, as a list of objects with this
387+
structure: {'from': 'value_1', 'to': 'value_a'}
388+
:param pattern (optional): when type is 'PATTERN', the pattern
389+
:param normalizationMode (optional): when type is 'VALUES_LIST', 'VALUES_MAPPING' or 'PATTERN', the normalization
390+
mode to use for value matching. One of 'EXACT', 'LOWERCASE', or 'NORMALIZED' (not available
391+
for 'PATTERN' type). Defaults to 'EXACT'.
392+
:param detectable (optional): whether DSS should consider assigning the meaning to columns set to 'Auto-detect'. Defaults to False.
393+
394+
:returns: A :class:`dataikuapi.dss.meaning.DSSMeaning` meaning handle
398395
"""
399396
resp = self._perform_text(
400397
"POST", "/meanings/", body={

0 commit comments

Comments
 (0)