Wrapping up a few Managing Table samples #7
Merged
tswast merged 9 commits intotswast:bq-snippetsfrom Apr 10, 2019
Merged
Conversation
tswast
requested changes
Apr 9, 2019
Owner
tswast
left a comment
There was a problem hiding this comment.
Looking good! A few updates needed on the tests.
| # TODO(developer): Set table_id to the ID of the table to fetch. | ||
| # table_id = 'your-project.your_dataset.your_table' | ||
|
|
||
| client.delete_table(table_id, not_found_ok=True) |
Owner
There was a problem hiding this comment.
Let's add a comment about what happens if the table is not found by default. (Raises google.api_core.exceptions.NotFound unless not_found_ok is True.)
Author
There was a problem hiding this comment.
Added comment about raising exception.
|
|
||
|
|
||
| def test_create_table(capsys, client, random_table_id): |
Owner
There was a problem hiding this comment.
Looks like we need to copy the test_create_table test to a test_create_table.py file so that we don't lose it.
Author
There was a problem hiding this comment.
Opps, accidentally deleted this file. Adding it back now!
| list_tables.list_tables(client, dataset_id) | ||
| out, err = capsys.readouterr() | ||
| assert "Tables contained in '{}':".format(dataset_id) in out | ||
| assert "{}".format(table_id) in out |
Owner
There was a problem hiding this comment.
Since table_id is already a string, no need for "{}".format(. This can be assert table_id in out.
tswast
pushed a commit
that referenced
this pull request
Apr 10, 2019
* Updated list tables snippet along with test. * Removed old list table snippet and upated location of sample
tswast
pushed a commit
that referenced
this pull request
Apr 10, 2019
* Updated list tables snippet along with test. * Removed old list table snippet and upated location of sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@engelke