Class ColumnFamily (2.22.0)

ColumnFamily(column_family_id, table, gc_rule=None)

Representation of a Google Cloud Bigtable Column Family.

We can use a ColumnFamily to:

  • create itself
  • update itself
  • delete itself

Parameters

NameDescription
column_family_id str

The ID of the column family. Must be of the form <code>_a-zA-Z0-9][-_.a-zA-Z0-9]</code>*.

table Table

The table that owns the column family.

gc_rule GarbageCollectionRule

(Optional) The garbage collection settings for this column family.

Properties

name

Column family name used in requests.

For example:

.. literalinclude:: snippets_table.py :start-after: [START bigtable_api_column_family_name] :end-before: [END bigtable_api_column_family_name] :dedent: 4

"projects/../zones/../clusters/../tables/../columnFamilies/.."

Returns
TypeDescription
strThe column family name.

Methods

create

create()

Create this column family.

For example:

.. literalinclude:: snippets_table.py :start-after: [START bigtable_api_create_column_family] :end-before: [END bigtable_api_create_column_family] :dedent: 4

delete

delete()

Delete this column family.

For example:

.. literalinclude:: snippets_table.py :start-after: [START bigtable_api_delete_column_family] :end-before: [END bigtable_api_delete_column_family] :dedent: 4

to_pb

to_pb()

Converts the column family to a protobuf.

Returns
TypeDescription
.table_v2_pb2.ColumnFamilyThe converted current object.

update

update()

Update this column family.

For example:

.. literalinclude:: snippets_table.py :start-after: [START bigtable_api_update_column_family] :end-before: [END bigtable_api_update_column_family] :dedent: 4