Skip to content

Commit 85b4380

Browse files
authored
Task/prepare 12.0.0 pip packages (#278)
* Code sync with DSS 12.0.0 * Prepare 12.0.0 bump * Relax requests requirement. Remove nose * Update date of release
1 parent 2f218b4 commit 85b4380

39 files changed

+2161
-1333
lines changed

Diff for: HISTORY.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
==========
33

4+
12.0.0 (2023-06-13)
5+
---------------------
6+
7+
* Initial release for DSS 12.0.0
8+
49
11.4.1.1 (2023-04-06)
510
---------------------
611

Diff for: dataikuapi/apinode_admin_client.py

+31-1
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,57 @@ def __init__(self, uri, api_key):
1717
########################################################
1818

1919
def create_service(self, service_id):
20+
"""
21+
Creates a new API service
22+
23+
:param service_id: id of the created API service
24+
"""
2025
self._perform_empty("POST", "services/", body = {
2126
"serviceId" : service_id
2227
})
2328

2429
def list_services(self):
30+
"""
31+
Lists the currently declared services and their enabled/disabled state
32+
33+
:return: a dict of services containing their id and state, as a JSON object
34+
:rtype: dict
35+
"""
2536
return self._perform_json("GET", "services")
2637

2738
def service(self, service_id):
2839
"""
2940
Gets a handle to interact with a service
41+
42+
:param service_id: id of requested service
43+
:rtype: :class: `dataikuapi.apinode_admin.service.APINodeService`
3044
"""
3145
return APINodeService(self, service_id)
3246

3347
def auth(self):
34-
"""Returns a handle to interact with authentication"""
48+
"""
49+
Returns a handle to interact with authentication
50+
51+
:rtype: :class: `dataikuapi.apinode_admin.auth.APINodeAuth`
52+
"""
3553
return APINodeAuth(self)
3654

3755
def get_metrics(self):
56+
"""
57+
Get the metrics for this API Node
58+
59+
:return: the metrics, as a JSON object
60+
:rtype: dict
61+
"""
3862
return self._perform_json("GET", "metrics")
3963

4064
def import_code_env_in_cache(self, file_dir, language):
65+
"""
66+
Import a code env in global cache from an exported code env base folder
67+
68+
:param file_dir: path of an exported code env base folder
69+
:param language: language of the code env (`python` or `R`)
70+
"""
4171
self._perform_empty("POST", "cached-code-envs", params={
4272
"fileDir": file_dir,
4373
"language": language

Diff for: dataikuapi/apinode_client.py

+39-17
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,49 @@ def forecast(self, endpoint_id, records, forced_generation=None, dispatch_key=No
9898
Forecast using a time series forecasting model on a DSS API node endpoint
9999
100100
:param str endpoint_id: Identifier of the endpoint to query
101-
:param records: List of time series data records to be used as an input for the
102-
time series forecasting model. Each record should be a dict where
103-
keys are feature names, and values feature values.
104-
Example: records = [
105-
{'date': '2015-01-04T00:00:00.000Z', 'timeseries_id': 'A', 'target': 10.0},
106-
{'date': '2015-01-04T00:00:00.000Z', 'timeseries_id': 'B', 'target': 4.5},
107-
{'date': '2015-01-05T00:00:00.000Z', 'timeseries_id': 'A', 'target': 2.0},
108-
...,
109-
{'date': '2015-03-20T00:00:00.000Z', 'timeseries_id': 'B', 'target': 1.3}
110-
]
101+
:param array records: List of time series data records to be used as an input for the
102+
time series forecasting model. Each record should be a dict where
103+
keys are feature names, and values feature values.
104+
105+
Example:
106+
107+
.. code-block:: python
108+
109+
records = [
110+
{'date': '2015-01-04T00:00:00.000Z',
111+
'timeseries_id': 'A', 'target': 10.0},
112+
{'date': '2015-01-04T00:00:00.000Z',
113+
'timeseries_id': 'B', 'target': 4.5},
114+
{'date': '2015-01-05T00:00:00.000Z',
115+
'timeseries_id': 'A', 'target': 2.0},
116+
...
117+
{'date': '2015-03-20T00:00:00.000Z',
118+
'timeseries_id': 'B', 'target': 1.3}
119+
]
120+
121+
111122
:param forced_generation: See documentation about multi-version prediction
112123
:param dispatch_key: See documentation about multi-version prediction
113124
114125
:return: a Python dict of the API answer. The answer contains a "results" key
115-
(which is an array of result objects, corresponding to the forecast records)
116-
Example: {'results': [
117-
{'forecast': 12.57, 'ignored': False, 'quantiles': [0.0001, 0.5, 0.9999], 'quantilesValues': [3.0, 16.0, 16.0],
118-
'time': '2015-03-21T00:00:00.000000Z', 'timeseriesIdentifier': {'timeseries_id': 'A'}},
119-
{'forecast': 15.57, 'ignored': False, 'quantiles': [0.0001, 0.5, 0.9999], 'quantilesValues': [3.0, 18.0, 19.0],
120-
'time': '2015-03-21T00:00:00.000000Z', 'timeseriesIdentifier': {'timeseries_id': 'B'}},
121-
...], ...}
126+
(which is an array of result objects, corresponding to the forecast records)
127+
Example:
128+
129+
.. code-block:: python
130+
131+
{'results': [
132+
{'forecast': 12.57, 'ignored': False,
133+
'quantiles': [0.0001, 0.5, 0.9999],
134+
'quantilesValues': [3.0, 16.0, 16.0],
135+
'time': '2015-03-21T00:00:00.000000Z',
136+
'timeseriesIdentifier': {'timeseries_id': 'A'}},
137+
{'forecast': 15.57, 'ignored': False,
138+
'quantiles': [0.0001, 0.5, 0.9999],
139+
'quantilesValues': [3.0, 18.0, 19.0],
140+
'time': '2015-03-21T00:00:00.000000Z',
141+
'timeseriesIdentifier': {'timeseries_id': 'B'}},
142+
...],
143+
...}
122144
"""
123145

124146
obj = {"items": records}

0 commit comments

Comments
 (0)