Skip to content

Commit 9d94d96

Browse files
committed
Fix attributes not working anymore for listitem and some typos [sc-58209]
1 parent ac84908 commit 9d94d96

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

dataikuapi/dss/admin.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import datetime
22

3-
from dataikuapi.dss.utils import DSSTaggableObjectListItem
4-
53
from .future import DSSFuture
64
import json, warnings
75

6+
87
class DSSConnectionInfo(dict):
98
"""A class holding read-only information about a connection.
109
Do not create this object directly, use :meth:`DSSConnection.get_info` instead.
@@ -1182,36 +1181,36 @@ def __init__(self, client, data):
11821181

11831182
def to_personal_api_key(self):
11841183
"""Gets the :class:`DSSPersonalApiKey` corresponding to this item"""
1185-
return DSSPersonalApiKey(self.client, self._data["id"])
1184+
return DSSPersonalApiKey(self.client, self["id"])
11861185

11871186
@property
11881187
def id(self):
1189-
return self._data["id"]
1188+
return self["id"]
11901189

11911190
@property
11921191
def user(self):
1193-
return self._data["user"]
1192+
return self["user"]
11941193

11951194
@property
11961195
def key(self):
1197-
return self._data["key"]
1196+
return self["key"]
11981197

11991198
@property
12001199
def label(self):
1201-
return self._data["label"]
1200+
return self["label"]
12021201

12031202
@property
12041203
def description(self):
1205-
return self._data["description"]
1204+
return self["description"]
12061205

12071206
@property
12081207
def created_on(self):
1209-
timestamp = self._data["createdOn"]
1208+
timestamp = self["createdOn"]
12101209
return datetime.datetime.fromtimestamp(timestamp / 1000) if timestamp > 0 else None
12111210

12121211
@property
12131212
def created_by(self):
1214-
return self._data["createdBy"]
1213+
return self["createdBy"]
12151214

12161215

12171216
class DSSCluster(object):
@@ -1350,7 +1349,7 @@ def save(self):
13501349
class DSSClusterStatus(object):
13511350
"""
13521351
The status of a cluster.
1353-
Do not create this object directly, use :meth:`DSSCluster.get_Status` instead.
1352+
Do not create this object directly, use :meth:`DSSCluster.get_status` instead.
13541353
"""
13551354
def __init__(self, client, cluster_id, status):
13561355
self.client = client

dataikuapi/dssclient.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import os.path as osp
2121
from .utils import DataikuException, dku_basestring_type
2222

23+
2324
class DSSClient(object):
2425
"""Entry point for the DSS API client"""
2526

@@ -1146,15 +1147,15 @@ def apply_kubernetes_namespaces_policies(self):
11461147
resp = self._perform_json("POST", "/admin/container-exec/actions/apply-kubernetes-policies")
11471148
return DSSFuture.from_resp(self, resp)
11481149

1149-
11501150
########################################################
11511151
# Global Instance Info
11521152
########################################################
11531153

11541154
def get_instance_info(self):
11551155
"""
11561156
Get global information about the DSS instance
1157-
:return: a :classss:`DSSInstanceInfo`
1157+
1158+
:returns: a :class:`DSSInstanceInfo`
11581159
"""
11591160
resp = self._perform_json("GET", "/instance-info")
11601161
return DSSInstanceInfo(resp)
@@ -1284,6 +1285,7 @@ def execute(self, settings=None):
12841285
return self.client._perform_json("POST", "/projects/import/%s/process" % (self.import_id),
12851286
body = settings)
12861287

1288+
12871289
class DSSInstanceInfo(object):
12881290
"""Global information about the DSS instance"""
12891291

0 commit comments

Comments
 (0)