Skip to content

Bigtable: docs Snippet only includes half of documentation #7522

@sethtroisi

Description

@sethtroisi

Small problem with snippets_table.py for google.cloud.bigtable.row.DirectRow.clear documentation only showing half the example code (e.g. not actually showing the running of the clear command)

Screenshot from 2019-03-16 10-42-40

This is because the test has two parts and the snippit is only including the first.

def test_bigtable_row_clear():
    # [START bigtable_row_clear]
    from google.cloud.bigtable import Client

    client = Client(admin=True)
    instance = client.instance(INSTANCE_ID)
    table = instance.table(TABLE_ID)

    row_key = b"row_key_1"
    row_obj = table.row(row_key)
    row_obj.set_cell(COLUMN_FAMILY_ID, COL_NAME1, b"cell-val")
    # [END bigtable_row_clear]

    mutation_size = row_obj.get_mutations_size()
    assert mutation_size > 0

    # [START bigtable_row_clear]
    row_obj.clear()
    # [END bigtable_row_clear]

    mutation_size = row_obj.get_mutations_size()
    assert mutation_size == 0

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.api: bigtableIssues related to the Bigtable API.api: spannerIssues related to the Spanner API.type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions