GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Find a better name for Row.commit_modifications() or fold the behavior into · Issue #1548 · googleapis/google-cloud-python

Find a better name for Row.commit_modifications() or fold the behavior into #1548

New issue
Copy link
New issue
Copy link
Closed
Closed
Find a better name for Row.commit_modifications() or fold the behavior into#1548
Copy link
Assignees
dhermes
Labels
api: bigtableIssues related to the Bigtable API.type: questionRequest for information or clarification. Not an issue.

Description

@dhermes
dhermes
opened on Feb 29, 2016
Issue body actions

See discussion in #1547 for context.

The name modifications is intended to map to the RPC method name ReadModifyWriteRow but the word modification is a synonym of mutation, so this method is poorly named. The method actually sends changes that

  • increment an int (stored in BT as 8 bytes)
  • append bytes to a cell value

so we should either

  • Fold it into Row.commit() as commit(append_only=True)
  • Rename it to something like Row.commit_cell_updates (or a better name than that)

Activity

  1. dhermes
    added
    api: bigtableIssues related to the Bigtable API.
    on Feb 29, 2016
  2. dhermes
    self-assigned this
    on Feb 29, 2016
  3. dhermes
    added
    type: questionRequest for information or clarification. Not an issue.
    on Feb 29, 2016
  4. dhermes commented on Feb 29, 2016

    @dhermes
    dhermes
    on Feb 29, 2016
    ContributorAuthor
    More actions

    @jonparrott @jgeewax @tseaver I'd love to have you all chime in.

  5. theacodes commented on Feb 29, 2016

    @theacodes
    theacodes
    on Feb 29, 2016
    Contributor
    More actions

    I like the first option, but unsure about complexity/edge cases.

    For option two, would commit_append be a better name?

  6. jgeewax commented on Feb 29, 2016

    @jgeewax
    jgeewax
    on Feb 29, 2016
    Contributor
    More actions

    I like the first also. commit() does all commits, commit(append_only=True) does just the appending commits. Seems super clear to me.

  7. tseaver commented on Feb 29, 2016

    @tseaver
    tseaver
    on Feb 29, 2016
    Contributor
    More actions

    What does the user expect the state-of-the-world to be after commit(append_only=True), assuming there were any pending non-append modifications?

  8. dhermes commented on Feb 29, 2016

    @dhermes
    dhermes
    on Feb 29, 2016
    ContributorAuthor
    More actions

    I think the best way forward is to actually create Row(..., append=True) and then make it so that in the append case, only append_cell_value and increment_cell_value will work.

    This way Row.commit() does have to worry about sending up to 3 API requests to the RPC methods MutateRow (no filter), CheckAndMutateRow (filter) and ReadModifyWriteRow (append).


    No issues with complexity, just worried that people would be confused. Here's some code snippets for how things work right now

    >>> row1 = table.row(b'row-key')
    >>> row2 = table.row(b'row-key', filter_=filter_)
    >>>
    >>> row1.set_cell(u'fam', b'col', b'val')
    >>> row2.set_cell(u'fam', b'col', b'val')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "gcloud/bigtable/row.py", line 166, in set_cell
        self._get_mutations(state).append(mutation_pb)
      File "gcloud/bigtable/row.py", line 97, in _get_mutations
        raise ValueError('A filter is set on the current row, but no '
    ValueError: A filter is set on the current row, but no state given for the mutation
    >>>
    >>> # Use state
    >>> row1.set_cell(u'fam', b'col', b'val', state=True)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "gcloud/bigtable/row.py", line 166, in set_cell
        self._get_mutations(state).append(mutation_pb)
      File "gcloud/bigtable/row.py", line 102, in _get_mutations
        raise ValueError('No filter was set on the current row, but a '
    ValueError: No filter was set on the current row, but a state was given for the mutation
    >>> row2.set_cell(u'fam', b'col', b'val', state=True)
    >>>
    >>> # state also an argument in delete(), delete_cell(), delete_cells()
    >>>
    >>> row1.append_cell_value(u'fam', b'col', b'extra-bytes')
    >>> row2.append_cell_value(u'fam', b'col', b'extra-bytes')
    >>>
    >>> row1.increment_cell_value(u'fam', b'col', 123)
    >>> row2.increment_cell_value(u'fam', b'col', 123)

  9. dhermes commented on Feb 29, 2016

    @dhermes
    dhermes
    on Feb 29, 2016
    ContributorAuthor
    More actions

    @tseaver Having a hard time answering your question. Can you give a scenario of what you have in mind?

  10. tseaver commented on Feb 29, 2016

    @tseaver
    tseaver
    on Feb 29, 2016
    Contributor
    More actions

    If commit() doesn't take the append_only argument (which I thought was the option being preferred), then my question is moot.

    [For rows created with append_only], only append_cell_value and increment_cell_value will work.

    That seems pretty natural: the user can't get the row into a state where uncommitted changes remain after a call to commit().

  11. dhermes commented on Feb 29, 2016

    @dhermes
    dhermes
    on Feb 29, 2016
    ContributorAuthor
    More actions

    Yup. Will implement and send out for PR.

  12. dhermes
    added a commit that references this issue on Feb 29, 2016

    Moving Bigtable Row.commit_modifications() into commit().

    This issue will close once commit 6c32cef is merged into the 'master' branch.
    6c32cef
  13. dhermes
    closed this as completedin #1557on Mar 8, 2016
  14. parthea
    added a commit that references this issue on Nov 24, 2025

    chore: resolve docstring issue where oneof reference is missing (#1548)

    69cdcc7
  15. parthea
    added a commit that references this issue on Mar 2, 2026

    chore: cleanup owlbot and release please files (#1548)

    bbfbb7b
  16. parthea
    added 2 commits that reference this issue on Mar 9, 2026

    feat(experimental): Implement `__init__` method for _AsyncReadObjectS…

    23f35a0

    docs: add samples from spanner/cloud-client (#117)

    ffb249b
  17. parthea
    added a commit that references this issue on Apr 1, 2026

    fix: pandas.cut returns labels index for numeric breaks when labels=F…

    c3e1651
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dhermes
    dhermes

Labels

api: bigtableIssues related to the Bigtable API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.