Google Cloud Bigtable Row for sending mutations conditionally.
Each mutation has an associated state: :data:True or :data:False.
When commit-ed, the mutations for the :data:True
state will be applied if the filter matches any cells in
the row, otherwise the :data:False state will be applied.
A ConditionalRow accumulates mutations in the same way a
DirectRow does:
If no mutations have been created in the row, no request is made.
The mutations will be applied conditionally, based on whether the
filter matches any cells in the ConditionalRow or not. (Each
method which adds a mutation has a state parameter for this
purpose.)
Mutations are applied atomically and in order, meaning that earlier
mutations can be masked / negated by later ones. Cells already present
in the row are left unchanged unless explicitly changed by a mutation.
After committing the accumulated mutations, resets the local
mutations.
The cell is determined by the row_key of this
ConditionalRow and the column. The column must be in
an existing .ColumnFamily (as determined by
column_family_id).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class ConditionalRow (2.32.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.32.0 (latest)](/python/docs/reference/bigtable/latest/google.cloud.bigtable.row.ConditionalRow)\n- [2.31.0](/python/docs/reference/bigtable/2.31.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.30.1](/python/docs/reference/bigtable/2.30.1/google.cloud.bigtable.row.ConditionalRow)\n- [2.29.0](/python/docs/reference/bigtable/2.29.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.28.1](/python/docs/reference/bigtable/2.28.1/google.cloud.bigtable.row.ConditionalRow)\n- [2.26.0](/python/docs/reference/bigtable/2.26.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.25.0](/python/docs/reference/bigtable/2.25.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.24.0](/python/docs/reference/bigtable/2.24.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.23.1](/python/docs/reference/bigtable/2.23.1/google.cloud.bigtable.row.ConditionalRow)\n- [2.22.0](/python/docs/reference/bigtable/2.22.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.21.0](/python/docs/reference/bigtable/2.21.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.20.0](/python/docs/reference/bigtable/2.20.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.19.0](/python/docs/reference/bigtable/2.19.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.18.1](/python/docs/reference/bigtable/2.18.1/google.cloud.bigtable.row.ConditionalRow)\n- [2.17.0](/python/docs/reference/bigtable/2.17.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.16.0](/python/docs/reference/bigtable/2.16.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.15.0](/python/docs/reference/bigtable/2.15.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.14.1](/python/docs/reference/bigtable/2.14.1/google.cloud.bigtable.row.ConditionalRow)\n- [2.13.2](/python/docs/reference/bigtable/2.13.2/google.cloud.bigtable.row.ConditionalRow)\n- [2.12.0](/python/docs/reference/bigtable/2.12.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.11.3](/python/docs/reference/bigtable/2.11.3/google.cloud.bigtable.row.ConditionalRow)\n- [2.10.1](/python/docs/reference/bigtable/2.10.1/google.cloud.bigtable.row.ConditionalRow)\n- [2.9.0](/python/docs/reference/bigtable/2.9.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.8.1](/python/docs/reference/bigtable/2.8.1/google.cloud.bigtable.row.ConditionalRow)\n- [2.7.1](/python/docs/reference/bigtable/2.7.1/google.cloud.bigtable.row.ConditionalRow)\n- [2.6.0](/python/docs/reference/bigtable/2.6.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.5.2](/python/docs/reference/bigtable/2.5.2/google.cloud.bigtable.row.ConditionalRow)\n- [2.4.0](/python/docs/reference/bigtable/2.4.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.3.3](/python/docs/reference/bigtable/2.3.3/google.cloud.bigtable.row.ConditionalRow)\n- [2.2.0](/python/docs/reference/bigtable/2.2.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.1.0](/python/docs/reference/bigtable/2.1.0/google.cloud.bigtable.row.ConditionalRow)\n- [2.0.0](/python/docs/reference/bigtable/2.0.0/google.cloud.bigtable.row.ConditionalRow)\n- [1.7.3](/python/docs/reference/bigtable/1.7.3/google.cloud.bigtable.row.ConditionalRow)\n- [1.6.1](/python/docs/reference/bigtable/1.6.1/google.cloud.bigtable.row.ConditionalRow)\n- [1.5.1](/python/docs/reference/bigtable/1.5.1/google.cloud.bigtable.row.ConditionalRow)\n- [1.4.0](/python/docs/reference/bigtable/1.4.0/google.cloud.bigtable.row.ConditionalRow)\n- [1.3.0](/python/docs/reference/bigtable/1.3.0/google.cloud.bigtable.row.ConditionalRow)\n- [1.2.1](/python/docs/reference/bigtable/1.2.1/google.cloud.bigtable.row.ConditionalRow)\n- [1.1.0](/python/docs/reference/bigtable/1.1.0/google.cloud.bigtable.row.ConditionalRow)\n- [1.0.0](/python/docs/reference/bigtable/1.0.0/google.cloud.bigtable.row.ConditionalRow)\n- [0.34.0](/python/docs/reference/bigtable/0.34.0/google.cloud.bigtable.row.ConditionalRow) \n\n ConditionalRow(row_key, table, filter_)\n\nGoogle Cloud Bigtable Row for sending mutations conditionally.\n\nEach mutation has an associated state: :data:`True` or :data:`False`.\nWhen `commit`-ed, the mutations for the :data:`True`\nstate will be applied if the filter matches any cells in\nthe row, otherwise the :data:`False` state will be applied.\n\nA `ConditionalRow` accumulates mutations in the same way a\n`DirectRow` does:\n\n- `set_cell`\n- `delete`\n- `delete_cell`\n- `delete_cells`\n\nwith the only change the extra `state` parameter::\n\u003e \u003e \u003e row_cond = table.row(b'row-key2', filter_=row_filter)\n\u003e \u003e \u003e row_cond.set_cell(u'fam', b'col', b'cell-val', state=True)\n\u003e \u003e \u003e row_cond.delete_cell(u'fam', b'col', state=False)\n| **Note:** As with `DirectRow`, to actually send these mutations to the Google Cloud Bigtable API, you must call `commit`.\n\nProperties\n----------\n\n### row_key\n\nRow key.\n\nFor example:\n\n.. literalinclude:: snippets_table.py\n:start-after: \\[START bigtable_api_row_row_key\\]\n:end-before: \\[END bigtable_api_row_row_key\\]\n:dedent: 4\n\n### table\n\nRow table.\n\nFor example:\n\n.. literalinclude:: snippets_table.py\n:start-after: \\[START bigtable_api_row_table\\]\n:end-before: \\[END bigtable_api_row_table\\]\n:dedent: 4\n\nMethods\n-------\n\n### clear\n\n clear()\n\nRemoves all currently accumulated mutations on the current row.\n\nFor example:\n\n.. literalinclude:: snippets_table.py\n:start-after: \\[START bigtable_api_row_clear\\]\n:end-before: \\[END bigtable_api_row_clear\\]\n:dedent: 4\n\n### commit\n\n commit()\n\nMakes a `CheckAndMutateRow` API request.\n\nIf no mutations have been created in the row, no request is made.\n\nThe mutations will be applied conditionally, based on whether the\nfilter matches any cells in the `ConditionalRow` or not. (Each\nmethod which adds a mutation has a `state` parameter for this\npurpose.)\n\nMutations are applied atomically and in order, meaning that earlier\nmutations can be masked / negated by later ones. Cells already present\nin the row are left unchanged unless explicitly changed by a mutation.\n\nAfter committing the accumulated mutations, resets the local\nmutations.\n\nFor example:\n\n.. literalinclude:: snippets_table.py\n:start-after: \\[START bigtable_api_row_commit\\]\n:end-before: \\[END bigtable_api_row_commit\\]\n:dedent: 4\n\n### delete\n\n delete(state=True)\n\nDeletes this row from the table.\n\n\u003cbr /\u003e\n\n| **Note:** This method adds a mutation to the accumulated mutations on this row, but does not make an API request. To actually send an API request (with the mutations) to the Google Cloud Bigtable API, call `commit`.\n.. literalinclude:: snippets_table.py :start-after: \\[START bigtable_api_row_delete\\] :end-before: \\[END bigtable_api_row_delete\\] :dedent: 4\n\n\u003cbr /\u003e\n\n### delete_cell\n\n delete_cell(column_family_id, column, time_range=None, state=True)\n\nDeletes cell in this row.\n\n\u003cbr /\u003e\n\n| **Note:** This method adds a mutation to the accumulated mutations on this row, but does not make an API request. To actually send an API request (with the mutations) to the Google Cloud Bigtable API, call `commit`.\n.. literalinclude:: snippets_table.py :start-after: \\[START bigtable_api_row_delete_cell\\] :end-before: \\[END bigtable_api_row_delete_cell\\] :dedent: 4\n\n\u003cbr /\u003e\n\n### delete_cells\n\n delete_cells(column_family_id, columns, time_range=None, state=True)\n\nDeletes cells in this row.\n\n\u003cbr /\u003e\n\n| **Note:** This method adds a mutation to the accumulated mutations on this row, but does not make an API request. To actually send an API request (with the mutations) to the Google Cloud Bigtable API, call `commit`.\n.. literalinclude:: snippets_table.py :start-after: \\[START bigtable_api_row_delete_cells\\] :end-before: \\[END bigtable_api_row_delete_cells\\] :dedent: 4\n\n\u003cbr /\u003e\n\n### set_cell\n\n set_cell(column_family_id, column, value, timestamp=None, state=True)\n\nSets a value in this row.\n\nThe cell is determined by the `row_key` of this\n`ConditionalRow` and the `column`. The `column` must be in\nan existing `.ColumnFamily` (as determined by\n`column_family_id`).\n\n\u003cbr /\u003e\n\n| **Note:** This method adds a mutation to the accumulated mutations on this row, but does not make an API request. To actually send an API request (with the mutations) to the Google Cloud Bigtable API, call `commit`.\n.. literalinclude:: snippets_table.py :start-after: \\[START bigtable_api_row_set_cell\\] :end-before: \\[END bigtable_api_row_set_cell\\] :dedent: 4\n\n\u003cbr /\u003e"]]