Class ColumnFamily (0.34.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_column_family_name] :end-before: [END bigtable_column_family_name]

"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_create_column_family] :end-before: [END bigtable_create_column_family]

delete

delete()

Delete this column family.

For example:

.. literalinclude:: snippets_table.py :start-after: [START bigtable_delete_column_family] :end-before: [END bigtable_delete_column_family]

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_update_column_family] :end-before: [END bigtable_update_column_family]