Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitting Bigtable Row into 3 classes based on the mutation type / RPC method used in commit() #1557

Merged
merged 15 commits into from
Mar 8, 2016

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Mar 2, 2016

Docs are still being updated, but I wanted to get this out there to speed up the review. Alternate implementation based on #1550.

I strongly urge reviewers to examine this commit-by-commit. The commit messages are fairly helpful (for the most part) and the diff of the PR as a whole is not so easy on the eyes.

Fixes #1548.

/cc @jonparrott @jgeewax

@dhermes dhermes added the api: bigtable Issues related to the Bigtable API. label Mar 2, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 2, 2016

:rtype: :class:`.Row`
:rtype: :class:`.DirectRow`

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor Author

dhermes commented Mar 3, 2016

@tseaver just saw tests were failing on Travis. Looking into it.

What do we need to do to keep this review moving? Really close to the finish line and want to get a release out

@dhermes
Copy link
Contributor Author

dhermes commented Mar 3, 2016

OK the failure is simple to address (just a long failure)

@dhermes
Copy link
Contributor Author

dhermes commented Mar 3, 2016

*lint failure. Phone autocorrect!

For now, just renaming Row->DirectRow and creating
2 do-nothing subclasses. Class will be torn down
in subsequent commits.
Simplifying most downstream issues by just removing any
code in DirectRow that branched based on the presence
of filter_.
Also simplifying DirectRow.commit() in the process.
Factoring behavior out into a non-public helper _set_cell()
and using that helper in both DirectRow and ConditionalRow.
Factoring behavior out into a non-public helper _delete()
and using that helper in both DirectRow and ConditionalRow.

Also making sure ConditionalRow.delete() gets tested (codepath
was only previously traversed via the parent class).
Factoring behavior out into a non-public helper _delete_cells()
and using that helper in both DirectRow and ConditionalRow.

Also making sure ConditionalRow.delete_cell(s) get tested (codepaths
were only previously traversed via the parent class).
Long-term fix will be to create the
`gcloud.bigtable.row_filters` module to reduce
the amount of code in `gcloud.bigtable.row`.

Also removing superflous assignment.
@theacodes
Copy link
Contributor

This mostly LGTM, pending the one open item.

@tseaver
Copy link
Contributor

tseaver commented Mar 3, 2016

LGTM

@dhermes
Copy link
Contributor Author

dhermes commented Mar 8, 2016

Merging this, will handle the open item in a small separate PR.

dhermes added a commit that referenced this pull request Mar 8, 2016
Splitting Bigtable Row into 3 classes based on the mutation type / RPC method used in commit()
@dhermes dhermes merged commit 793b676 into googleapis:master Mar 8, 2016
@dhermes dhermes deleted the fix-1548-part2 branch March 8, 2016 20:41
dhermes added a commit to dhermes/google-cloud-python that referenced this pull request Mar 10, 2016
This is a follow-up to googleapis#1557 and prevents strange-ly true
statements like `isinstance(cond_row, DirectRow)`.
dhermes added a commit to dhermes/google-cloud-python that referenced this pull request Mar 10, 2016
This is a follow-up to googleapis#1557 and prevents strange-ly true
statements like `isinstance(cond_row, DirectRow)`.
dhermes added a commit to dhermes/google-cloud-python that referenced this pull request Mar 11, 2016
This is a follow-up to googleapis#1557 and prevents strange-ly true
statements like `isinstance(cond_row, DirectRow)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants