Reputation: 141
I am trying to list a dataproc cluster to get the worker node names. The datatype that the code is returning is and I want to convert it to list
for cluster in dataproc_cluster_client.list_clusters(project_id, region):
if cluster.cluster_name == 'test':
print(type(cluster.config.worker_config.instance_names))
print(type(cluster.config.master_config.instance_names))
Upvotes: 11
Views: 11085
Reputation: 1094
For those wondering, conversion to numpy array can be done as simply as:
x = np.array(proto_object)
Upvotes: 0
Reputation: 131
list(cluster.config.worker_config.instance_names) to convert to a Python list
Upvotes: 12