Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

samples: Add BigTable delete samples#590

Merged
Mariatta merged 12 commits into
mainfrom
doc-delete-sample-snippets
Jun 21, 2022
Merged

samples: Add BigTable delete samples#590
Mariatta merged 12 commits into
mainfrom
doc-delete-sample-snippets

Conversation

@Mariatta
Copy link
Copy Markdown
Contributor

@Mariatta Mariatta commented May 20, 2022

  • Add the deleteion snippets
  • Add test cases

Closes internal issue #213629071

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #213629071 🦕

- Add the deleteion snippets
- Add test cases

Closes internal issue #213629071
@Mariatta Mariatta requested a review from a team as a code owner May 20, 2022 21:24
@Mariatta Mariatta requested review from a team and leahecole May 20, 2022 21:24
@product-auto-label product-auto-label Bot added size: l Pull request size is large. api: bigtable Issues related to the googleapis/python-bigtable API. samples Issues that are directly related to samples. labels May 20, 2022
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented May 20, 2022

Here is the summary of changes.

You are about to add 8 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@Mariatta Mariatta force-pushed the doc-delete-sample-snippets branch from 2ad0bec to 10dea88 Compare May 20, 2022 21:30
@Mariatta Mariatta force-pushed the doc-delete-sample-snippets branch from a4bedb5 to 12c3e98 Compare May 20, 2022 21:53
@Mariatta Mariatta changed the title doc: Add BigTable delete samples docs: Add BigTable delete samples May 24, 2022
kolea2
kolea2 previously requested changes May 25, 2022
Comment thread samples/snippets/deletes/deletes_snippets.py Outdated
Comment thread samples/snippets/deletes/deletes_snippets.py Outdated
Comment thread samples/snippets/deletes/deletes_test.py Outdated
@Mariatta Mariatta requested a review from kolea2 May 30, 2022 20:45
@kolea2
Copy link
Copy Markdown
Contributor

kolea2 commented Jun 2, 2022

@cshaff0524

@kolea2 kolea2 changed the title docs: Add BigTable delete samples samples: Add BigTable delete samples Jun 2, 2022
Comment thread samples/snippets/deletes/deletes_snippets.py
Copy link
Copy Markdown
Contributor

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, would also like @danieljbruce to take a look with @cshaff0524 :)

@kolea2 kolea2 dismissed their stale review June 3, 2022 17:32

resolved

Copy link
Copy Markdown

@cshaff0524 cshaff0524 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One minor comment.

Comment thread samples/snippets/deletes/deletes_snippets.py Outdated
@Mariatta Mariatta requested a review from kolea2 June 6, 2022 20:41
@Mariatta
Copy link
Copy Markdown
Contributor Author

@kolea2 @cshaff0524 let me know if you have other concerns about this PR. Thanks.

Copy link
Copy Markdown

@danieljbruce danieljbruce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! I left a few comments/questions about how the framework is used and I left a few comments to make sure Python and Node.js line up.



# [START bigtable_delete_from_column_sample]
def delete_from_column_sample(project_id, instance_id, table_id):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread samples/snippets/deletes/deletes_snippets.py
Comment thread samples/snippets/deletes/deletes_snippets.py Outdated
Comment thread samples/snippets/deletes/deletes_snippets.py
Comment thread samples/snippets/deletes/deletes_snippets.py
Comment thread samples/snippets/deletes/deletes_test.py
PROJECT, BIGTABLE_INSTANCE, table_id
)
out, _ = capsys.readouterr()
snapshot.assert_match(out)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these two last lines of code are written 8 times, do you think we should refactor them out into a function and call them in each test case?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I see the reads_test doesn't do it that way though. It might be nice if all the samples were done this way, but I'm really curious about your thoughts.

Comment thread samples/snippets/deletes/noxfile.py

def test_delete_column_family(capsys, snapshot, table_id):
deletes_snippets.delete_column_family_sample(PROJECT, BIGTABLE_INSTANCE, table_id)
out, _ = capsys.readouterr()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice the snapshots at the end of the PR are empty. Ideally after each test I think we should print the data that remains in the table like we do in readSnippets. I think this just means adding the following code to the end of each function in delete_snippets.js.

for row in rows:
    print_row(row)

Copy link
Copy Markdown
Contributor Author

@Mariatta Mariatta Jun 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I had the snapshots to print things out at first, but I removed the prints. I think it was not necessary and noisy. I decided to go with calling the functions and checking that there is no errors.

Comment thread samples/snippets/deletes/deletes_snippets.py Outdated
@Mariatta Mariatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 17, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 17, 2022
@Mariatta
Copy link
Copy Markdown
Contributor Author

The pre-release CI is not required (and still in the works) so we can ignore it.

@Mariatta Mariatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 20, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 20, 2022
@Mariatta Mariatta merged commit 16fa5ad into main Jun 21, 2022
@Mariatta Mariatta deleted the doc-delete-sample-snippets branch June 21, 2022 16:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigtable Issues related to the googleapis/python-bigtable API. samples Issues that are directly related to samples. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants