Skip to content

Commit

Permalink
Using CopyFrom to set protobuf message fields (instead of `MergeFro…
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes authored and landrito committed Aug 21, 2017
1 parent 12360f5 commit 8bb5002
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bigtable/google/cloud/bigtable/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def create(self, initial_split_keys=None, column_families=()):
table_pb = table_v2_pb2.Table()
for col_fam in column_families:
curr_id = col_fam.column_family_id
table_pb.column_families[curr_id].MergeFrom(col_fam.to_pb())
table_pb.column_families[curr_id].CopyFrom(col_fam.to_pb())

request_pb = table_admin_messages_v2_pb2.CreateTableRequest(
initial_splits=initial_split_keys or [],
Expand Down
2 changes: 1 addition & 1 deletion bigtable/tests/unit/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def _create_test_helper(self, initial_split_keys, column_families=()):
for cf in column_families:
cf_pb = table_pb.column_families[cf.column_family_id]
if cf.gc_rule is not None:
cf_pb.gc_rule.MergeFrom(cf.gc_rule.to_pb())
cf_pb.gc_rule.CopyFrom(cf.gc_rule.to_pb())
request_pb = _CreateTableRequestPB(
initial_splits=splits_pb,
parent=self.INSTANCE_NAME,
Expand Down

0 comments on commit 8bb5002

Please sign in to comment.