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 — BigQuery Beta 2 Changes by tswast · Pull Request #4245 · googleapis/google-cloud-python

Conversation

@tswast

@tswast tswast commented Oct 24, 2017

Copy link
Copy Markdown
Contributor

This pull request implements requirements for the beta 2 launch as well as a redesign of the API surface. Changes include:

  • Query and view operations default to the Standard SQL dialect.
  • Client functions related to jobs like running queries immediately start the job.
    • Use QueryJobConfig and analogous classes to configure optional properties about the job before starting it with the client methods.
    • Use the concurrent.futures API (e.g. result()) on jobs to wait for jobs to complete. In the case of QueryJob, the result() method returns an iterator over the rows of the destination table.
  • Added TableReference and DatasetReference classes to be more clear about when an object does not contain additional properties of the resource.
  • Functions to create/get/update/delete datasets and tables moved from Table and Dataset to the Client class.
  • Use Client.create_rows() instead of Table.insert_data() to stream rows to a table.
  • Use Client.list_rows() instead of Table.fetch_data().
  • Row iterators allow access to column values by keyword or attribute, in addition to by integer index.

/cc @alixhami @jba

Sorry, something went wrong.

Uh oh!

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

All reactions
tseaver and others added 30 commits October 12, 2017 13:27
@tseaver @tswast
Rename job classes (#3797)
81ffeb2
* Rename class: 'jobs.LoadTableFromStorageJob' -> 'jobs.LoadJob'.

* Rename class: 'jobs.ExtractTableToStorageJob' -> 'jobs.ExtractJob'.
@tseaver @tswast
Rename class: 'dataset.AccessGrant' -> 'dataset.AccessEntry'. (#3798)
63e0ebe
* Rename class: 'dataset.AccessGrant' -> 'dataset.AccessEntry'.

* PEP8 names for unit test helpers.

* Rename 'Dataset.access_grants' -> 'Dataaset.access_entries'.
@tseaver @tswast
Add 'QueryJob.query_plan' property. (#3799)
040a39e
@tseaver @tswast
Add new scalar statistics properties to 'QueryJob' (#3800)
2583611
* Add 'QueryJob.total_bytes_processed' property.
* Add 'QueryJob.total_bytes_billed' property.
* Add 'QueryJob.billing_tier' property.
* Add 'QueryJob.cache_hit' property.
* Add 'QueryJob.num_dml_affected_rows' property.
* Add 'QueryJob.statement_type' property.
@tseaver @tswast
Add 'QueryJob.referenced_tables' property. (#3801)
d4e2feb
@tseaver @tswast
Add 'QueryJob.undeclared_query_parameters' property. (#3802)
daff546
@tseaver @tswast
Fix system test broken by PR #3798. (#3936)
0379e77
@tseaver @tswast
Add 'Client.get_job' API wrapper. (#3804)
0aac7a0
* Allow assigning 'None' to '_TypedProperty' properties.

* Ensure that configuration properties are copied when (re)loading jobs.
@tseaver @tswast
Add 'ExtractTableStorageJob.destination_uri_file_counts' property. (#…
3a1c0fb
…3803)
@alixhami @tswast
bigquery add DatasetReference class and tests (#3938)
f17bb9c
@alixhami @tswast
BigQuery: Add TestReference class. Add table function to DatasetRefer…
10f5a2d
…ence (#3942)
@alixhami @tswast
BigQuery: Modify client.dataset() to return DatasetReference instead …
ec90007
…of Dataset. (#3944)

* BigQuery: Add TestReference class. Add table function to DatasetReference

* BigQuery: Modify client.dataset() to return DatasetReference instead of Dataset.

* Bigquery: client.dataset() uses default project if not specified
@jba @tswast
bigquery: rename TableReference.dataset_ref (#3953)
a71a8c3
* bigquery: rename TableReference.dataset_ref

Rename to dataset to be consistent with Client.dataset. Both
methods actually return a DatasetReference.

* fix broken tests
@jba @tswast
bigquery: rename name field of Dataset to dataset_id (#3955)
4aba841
* bigquery: rename name field of Dataset to dataset_id

Rename the former dataset_id property to full_dataset_id.

Also rename Table.dataset_name to Table.dataset_id.

Perform other renamings (of various variables and constants).

These names match usage better. The API's Dataset.id field is
"project:dataset_id", which is confusing and basically useless,
so it's a mistake to call that dataset_id.

* fix long line

* fix long line
@jba @tswast
bigquery: rename name field of Table to table_id (#3959)
6f1c8f3
* bigquery: rename name field of Table to table_id

Also rename table_id to full_table_id.

* fix lint errors

* fix doc
@tswast
BQ: rename XJob.name to XJob.job_id. (#3962)
6923e8e
* BQ: rename XJob.name to XJob.job_id.

* BQ: Remove references to table.name
@tswast
Parse timestamps in query parameters using canonical format (#3945)
2ac3cd6
* Parse timestamps in query parameters according to BigQuery canonical timestamp format.

The timestamp format in query parameters follows the canonical format
specified at
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#timestamp-type

This fixes a system test error which was happening in the bigquery-b2
branch.

* Support more possible timestamp formats.

Any of these formats may be returned from the BigQuery API.

* Chop and string-replace timestamps into a canonical format.

* BQ: fix lint errors. Remove references to table.name
@alixhami @tswast
BigQuery: Adds client.get_dataset() and removes dataset.reload() (#3973)
4e94c48
* BigQuery: Adds client.get_dataset() and removes dataset.reload()

* BigQuery: changes dataset.name to dataset.dataset_id in test

* fixes client.get_dataset() docstring and removes unnecessary test variable
@alixhami @tswast
BigQuery: Changes DatasetReference project_id property to project to …
e79384f
…match Dataset (#3993)
@jba @tswast
bigquery: add client.create_dataset; remove dataset.create (#3982)
bef85b7
* bigquery: add client.create_dataset; remove dataset.create

* fix lint

* increase coverage to 100%

* really fix coverage

* fix lint
@jba @tswast
bigquery: remove dataset.exists (#3996)
ecf88e4
* bigquery: remove dataset.exists

Dataset won't be able to support this method when we remove its client.

Don't add client.dataset_exists; the user can use client.get_dataset and
catch NotFound.

* fix lint

* fix lint agian

* fix more lint
@alixhami @tswast
BigQuery: Updates Table constructor to use TableReference as parameter (
01b812b
#3997)

* wip update Table contructor

* BigQuery: Updates Table constructor to use TableReference as parameter

* fixes circular import error with Python 2.7
@tswast
BQ: client.extract_table starts extract job (#3991)
3b81a14
* BQ: client.extract_table starts extract job

Add system tests for extract_table.

* BigQuery: client.extract_table use `**kwargs` for Python 2.7.

* BQ: extract_table. Use dict.get for kwargs. job_id instead of job_name.
@alixhami @tswast
BigQuery: Adds client.get_table() and removes table.reload() (#4004)
1f4381f
* WIP adds client.get_table()

* BigQuery: Adds client.get_table() and removes table.reload()

* removes unnecessary variable

* adds system test for client.get_table()
@jba @tswast
bigquery: add Client.update_dataset (#4003)
04da9c0
* bigquery: add Client.update_dataset

Remove Dataset.patch and Dataset.update.

* improve cover

* more coverage

* update system tests

* more coverage

* add creds to client

* small changes

* .

* convert Python field name to API field name
@alixhami @tswast
BigQuery: Remove dataset property from TableReference and add project…
970f6f7
…/dataset_id properties (#4011)

* adds dataset_id and project properties to TableReference

* Remove dataset property from Table and TableReference
@jba @tswast
bigquery: add client.delete_dataset (#4012)
e5b91ea
* bigquery: add client.delete_dataset

* support Dataset as well as DatasetReference

* fix lint
@alixhami @tswast
updates dataset.table() to return a TableReference instead of a Table (…
31a6219
…#4014)
@jba @tswast
bigquery: add client.list_dataset_tables (#4013)
97f4e1c
Remove Dataset.list_tables
@jba @tswast
bigquery: remove client from Dataset (#4018)
a8169a4
jba and others added 9 commits October 16, 2017 19:39
@jba
bigquery: support table labels (#4207)
6dae47f
@alixhami @tswast
BigQuery: removes LoadJob error for autodetect + schema (#4213)
f192cb6
@tswast
BigQuery: populate timeout parameter for getQueryResults (#4209)
af3da30
* BigQuery: populate timeout parameter for getQueryResults

This will allow QueryJob to respect the timeout value for futures.

* query_rows: Clarify that timeout is in seconds.

* Wait until the end of calculations to convert to milliseconds.
@alixhami @tswast
BigQuery: Adds helper function for snake to camel case conversion (#4160
c82d512
)

* adds helper function for snake to camel case conversion

* adds unit test
@alixhami @tswast
Renames client.load_table_from_storage() to client.load_table_from_ur…
d19b6c3
…i() (#4235)
@alixhami @tswast
BigQuery: Updates snippets for BigQuery Beta 2 changes (#4237)
4ce4a90
* Updates snippets for BigQuery Beta 2 changes

* fixes flake8 issues

* removes module imports

* fixes snippets
@tswast
Merge remote-tracking branch 'upstream/master' into bigquery-b2
c35eae6
@tswast
BigQuery: make docstrings use bigquery module, like the samples do. (#…
61bb7a0
…4236)

* BigQuery: make docstrings use bigquery module, like the samples do.

All the public classes we expect developers to use are included in the
`google.cloud.bigquery` module, and it is this module that we use in
code samples.

Also, I found one error in the Bigtable docs where `Row` was not being
used as a local reference and conflicted with the BigQuery Row.

* Adjust heading underline.
@tswast
BigQuery: Make job.begin() method private. (#4242)
df016c2
@tswast tswast added the api: bigquery Issues related to the BigQuery API. label Oct 24, 2017
@tswast
tswast requested review from dhermes, lukesneeringer, theacodes and tseaver October 24, 2017 16:34
@tswast

tswast commented Oct 24, 2017

Copy link
Copy Markdown
Contributor Author

Question: When we merge this are we going to squash it?

All reactions

Sorry, something went wrong.

Uh oh!

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

This was referenced Oct 24, 2017
BigQuery job.results() still in usage doc #3907
Closed
Cannot set billingTier in synchronous query #3929
Closed
@tseaver

tseaver commented Oct 24, 2017

Copy link
Copy Markdown
Contributor

@tswast We'd have to, unless one of us does the merge at the command line (non-squash PR merge is disabled for the project).

All reactions

Sorry, something went wrong.

Uh oh!

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

This was referenced Oct 24, 2017
BigQuery: support labels field of Datasets and Table resources #2931
Closed
Add startIndex to bigquery.table.Table.fetch_data #3081
Closed
Add support for "external" tables #2372
Closed
autodetect schema parameter in Table.upload_from_file #4024
Closed
test_sync_query_w_dml has num_dml_affected_rows unset #3742
Closed
@lukesneeringer

lukesneeringer commented Oct 24, 2017

Copy link
Copy Markdown
Contributor

Question: When we merge this are we going to squash it?

I can enable non-squash merge temporarily if you want.

All reactions

Sorry, something went wrong.

Uh oh!

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

@tseaver

tseaver commented Oct 24, 2017

Copy link
Copy Markdown
Contributor

@lukesneeringer

I can enable non-squash merge temporarily if you want.

ISTM we could just do it at the command line:

$ git checkout master && git fetch --all --prune && git merge upstream master
$ git merge bigquery-b2 
$ git push upstream master
All reactions

Sorry, something went wrong.

Uh oh!

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

@tswast
tswast merged commit 09cf23a into master Oct 24, 2017
@dhermes
dhermes deleted the bigquery-b2 branch November 22, 2017 17:15
parthea pushed a commit that referenced this pull request Oct 21, 2023
Takashi Matsuo @leahecole @busunkim96
testing(asset): use conftest.py [(#4245)](GoogleCloudPlatform/python-…
acbc95b
…docs-samples#4245)

fixes #4235
(by retrying upon InternalServerError)

Co-authored-by: Leah E. Cole <[email protected]>
parthea pushed a commit that referenced this pull request Nov 22, 2025
@tswast
Merge pull request #4245 from GoogleCloudPlatform/bigquery-b2
8e11e51
BigQuery Beta 2 Changes
parthea pushed a commit that referenced this pull request Nov 24, 2025
@tswast
Merge pull request #4245 from GoogleCloudPlatform/bigquery-b2
ac30726
BigQuery Beta 2 Changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lukesneeringer lukesneeringer Awaiting requested review from lukesneeringer
@tseaver tseaver Awaiting requested review from tseaver
@theacodes theacodes Awaiting requested review from theacodes
@dhermes dhermes Awaiting requested review from dhermes

Uh oh!

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

Assignees

No one assigned

Labels

api: bigquery Issues related to the BigQuery API.

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.

5 participants

@tswast @tseaver @lukesneeringer @alixhami @jba
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.