File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 13
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
+
16
17
# [START bigtable_quickstart]
17
18
import argparse
18
19
21
22
22
23
def main (project_id = "project-id" , instance_id = "instance-id" ,
23
24
table_id = "my-table" ):
24
- # Creates a Bigtable client
25
+ # Create a Cloud Bigtable client.
25
26
client = bigtable .Client (project = project_id )
26
27
27
- # Connect to an existing instance:my-bigtable-instance
28
+ # Connect to an existing Cloud Bigtable instance.
28
29
instance = client .instance (instance_id )
29
30
30
- # Connect to an existing table:my-table
31
+ # Open an existing table.
31
32
table = instance .table (table_id )
32
33
33
- key = 'r1'
34
- row = table .read_row (key .encode ('utf-8' ))
34
+ row_key = 'r1'
35
+ row = table .read_row (row_key .encode ('utf-8' ))
35
36
36
37
column_family_id = 'cf1'
37
38
column_id = 'c1' .encode ('utf-8' )
38
39
value = row .cells [column_family_id ][column_id ][0 ].value .decode ('utf-8' )
39
40
40
- print ('Row key: {}\n Data: {}' .format (key , value ))
41
+ print ('Row key: {}\n Data: {}' .format (row_key , value ))
41
42
42
43
43
44
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments