Skip to content

Commit 6ff3725

Browse files
dhermesJon Wayne Parrott
authored andcommitted
Adding Bigtable Cluster location on create() request. (#3646)
1 parent 08021bd commit 6ff3725

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

bigtable/google/cloud/bigtable/cluster.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def _prepare_create_request(cluster):
4949
parent=cluster._instance.name,
5050
cluster_id=cluster.cluster_id,
5151
cluster=data_v2_pb2.Cluster(
52+
location=cluster.location,
5253
serve_nodes=cluster.serve_nodes,
5354
),
5455
)

bigtable/tests/unit/test_cluster.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,14 @@ def test_it(self):
393393
instance = _Instance(INSTANCE_ID, client)
394394
cluster = Cluster(CLUSTER_ID, instance,
395395
serve_nodes=SERVE_NODES)
396+
cluster.location = u'projects/prahj-ekt/locations/zona-tres'
396397

397398
request_pb = self._call_fut(cluster)
398399

399400
self.assertEqual(request_pb.cluster_id, CLUSTER_ID)
400401
self.assertEqual(request_pb.parent, instance.name)
401402
self.assertEqual(request_pb.cluster.serve_nodes, SERVE_NODES)
403+
self.assertEqual(request_pb.cluster.location, cluster.location)
402404

403405

404406
def _ClusterPB(*args, **kw):

0 commit comments

Comments
 (0)