Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions dataikuapi/dssclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,12 @@ def create_cluster(self, cluster_name, cluster_type='manual', params=None):
:returns: A :class:`dataikuapi.dss.admin.DSSCluster` cluster handle

"""
definition = {}
definition['name'] = cluster_name
definition['type'] = cluster_type
definition['params'] = params if params is not None else {}
definition = {
'name': cluster_name,
'type': cluster_type,
'params': params if params is not None else {},
}

Comment on lines -570 to +575

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DSSClient.create_cluster refactored with the following changes:

resp = self._perform_json(
"POST", "/admin/clusters/", body=definition)
if resp is None:
Expand Down Expand Up @@ -681,7 +683,7 @@ def create_meaning(self, id, label, type, description=None,
:returns: A :class:`dataikuapi.dss.meaning.DSSMeaning` meaning handle
"""
def make_entry(v):
if isinstance(v, str) or isinstance(v, unicode):
if isinstance(v, (str, unicode)):
Comment on lines -684 to +686

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DSSClient.make_entry refactored with the following changes:

return {'value':v}
else:
return v
Expand Down