Skip to content

Commit 1baa945

Browse files
Convert tags from dict to list
Signed-off-by: Saravanan Raju <saravanan.footloose@gmail.com>
1 parent e9e0ee7 commit 1baa945

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/cdpy/dw.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,20 @@ def delete_cluster(self, cluster_id: str, force: bool = False):
9999

100100
def create_vw(self, cluster_id:str, dbc_id:str, vw_type:str, name:str, template:str = None,
101101
autoscaling_min_cluster:int = None, autoscaling_max_cluster:int = None,
102-
service_config_req:str = None, tags:list = None):
102+
service_config_req:str = None, tags:dict = None):
103103
if all(x is not None for x in [autoscaling_min_cluster, autoscaling_max_cluster]):
104104
autoscaling_options = dict(minClusters=autoscaling_min_cluster, maxClusters=autoscaling_max_cluster)
105105
else:
106106
autoscaling_options = None
107+
108+
tag_list = []
109+
for item in tags:
110+
tag_list = tag_list.append({'key': item.key, 'value': item.value})
111+
107112
return self.sdk.call(
108113
svc='dw', func='create_vw', ret_field='vwId', clusterId=cluster_id, dbcId=dbc_id,
109114
vwType=vw_type, name=name, template=template, autoscaling=autoscaling_options,
110-
config=service_config_req, tags=tags
115+
config=service_config_req, tags=tag_list
111116
)
112117

113118
def create_dbc(self, cluster_id:str, name:str, load_demo_data: bool = None):

0 commit comments

Comments
 (0)