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 — Wrapping up a few Managing Table samples by lbristol88 · Pull Request #7 · tswast/google-cloud-python

Conversation

@lbristol88

@lbristol88 lbristol88 commented Apr 9, 2019

Copy link
Copy Markdown

@engelke

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lbristol88 added 7 commits April 8, 2019 20:43
@lbristol88
Updated list tables snippet along with test.
3eddf42
@lbristol88
Removed old list table snippet and upated location of sample
6db8e45
@lbristol88
Updated get_table function
f39c229
@lbristol88
Corrected typo
dd2a22a
@lbristol88
Updated delete_table function
bdb8d5c
@lbristol88
Removed unnecessary parameter in test.
13cb4b8
@lbristol88
Updated table samples and their tests.
e4e1f42
@lbristol88 lbristol88 changed the title Added collection of Managing Table samples Wrapping up a few Managing Table samples Apr 9, 2019
tswast
tswast requested changes Apr 9, 2019
View reviewed changes

@tswast tswast left a comment

Copy link
Copy Markdown
Owner

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looking good! A few updates needed on the tests.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bigquery/samples/delete_table.py
# 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)

@tswast tswast Apr 9, 2019

Copy link
Copy Markdown
Owner

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lbristol88 lbristol88 Apr 10, 2019

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Added comment about raising exception.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bigquery/samples/tests/test_delete_table.py


def test_create_table(capsys, client, random_table_id):

@tswast tswast Apr 9, 2019

Copy link
Copy Markdown
Owner

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lbristol88 lbristol88 Apr 10, 2019

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Opps, accidentally deleted this file. Adding it back now!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread bigquery/samples/tests/test_get_table.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread bigquery/samples/tests/test_list_tables.py Outdated
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

@tswast tswast Apr 9, 2019

Copy link
Copy Markdown
Owner

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Since table_id is already a string, no need for "{}".format(. This can be assert table_id in out.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lbristol88 lbristol88 Apr 10, 2019

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Updated!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lbristol88 and others added 2 commits April 9, 2019 22:16
@lbristol88
Made changes to tests per review and readded missing create table tes…
341afc3
…t file.
@tswast
Add condition for when the exception is raised.
375de0b
tswast
tswast approved these changes Apr 10, 2019
View reviewed changes

@tswast tswast left a comment

Copy link
Copy Markdown
Owner

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks great, thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tswast
tswast merged commit 6b48967 into tswast:bq-snippets Apr 10, 2019
tswast pushed a commit that referenced this pull request Apr 10, 2019
@lbristol88 @tswast
Wrapping up a few Managing Table samples (#7)
094602b
* 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
@lbristol88 @tswast
Wrapping up a few Managing Table samples (#7)
8724e87
* Updated list tables snippet along with test.

* Removed old list table snippet and upated location of sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tswast tswast tswast approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@lbristol88 @tswast
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.
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.