Skip to content

Commit 8439235

Browse files
committed
Move get_resolved_variables from DSSClient to DSSProject
[ch64060]
1 parent 2b8d202 commit 8439235

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

dataikuapi/dss/project.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,22 @@ def get_variables(self):
961961
return self.client._perform_json(
962962
"GET", "/projects/%s/variables/" % self.project_key)
963963

964+
def get_resolved_variables(self, typed=False):
965+
"""
966+
Get a dictionary of resolved variables of this project.
967+
968+
:param bool typed: if True, the variable values will be typed in the returned dict, defaults to False
969+
:return: a dictionary with instance and project variables merged
970+
971+
:returns: a dictionary of the resolved project variables
972+
"""
973+
return self.client._perform_json(
974+
"GET",
975+
"/projects/%s/variables-resolved" % self.project_key,
976+
params={
977+
"typed": "true" if typed else "false"
978+
})
979+
964980
def set_variables(self, obj):
965981
"""
966982
Sets the variables of this project.

dataikuapi/dssclient.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -777,24 +777,6 @@ def get_global_variables(self):
777777
variables = self._perform_json("GET", "/admin/variables/")
778778
return DSSInstanceVariables(self, variables)
779779

780-
def get_resolved_variables(self, project_key=None, typed=False):
781-
"""
782-
Get a dictionary of resolved variables for a project.
783-
784-
:param str project_key: the project key, defaults to the current default project
785-
:param bool typed: if True, the variable values will be typed in the returned dict, defaults to False
786-
:return: a dictionary with instance and project variables merged
787-
788-
:returns: a Python dictionary of the resolved project variables
789-
"""
790-
import dataiku
791-
return self._perform_json(
792-
"GET",
793-
"/projects/%s/variables-resolved" % dataiku.default_project_key() if project_key is None else project_key,
794-
params={
795-
"typed": "true" if typed else "false"
796-
})
797-
798780
def set_variables(self, variables):
799781
"""
800782
Deprecated. Use get_global_variables().save()

0 commit comments

Comments
 (0)