Skip to content

deprecate(bigquery): deprecate client.dataset() in favor of DatasetReference - #7753

Merged
plamut merged 4 commits into
googleapis:masterfrom
tswast:bq-dot-dataset-deprecation
Jan 27, 2020
Merged

deprecate(bigquery): deprecate client.dataset() in favor of DatasetReference#7753
plamut merged 4 commits into
googleapis:masterfrom
tswast:bq-dot-dataset-deprecation

Conversation

@tswast

@tswasttswast commented Apr 19, 2019

Copy link
Copy Markdown
Contributor

Now that all client methods that take a DatasetReference or
TableReference also take a string, the client.dataset() method is
unnecessary and confusing.

Closes#8989.

@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 19, 2019
@tswast

Copy link
Copy Markdown
ContributorAuthor

@crwilcox I was inspired by our conversation today.

Note: I've created this as a draft pull request because after I made this commit, I realized we still call .dataset() 96 times in our samples at docs/snippets.py, and that's after @lbristol88 already moved a bunch over to the new "just use a string instead of a reference" way of doing things! I would feel better about adding the deprecation notice after we update the rest of our samples.

@yoshi-automationyoshi-automation added the 🚨 This issue needs some love. label Apr 26, 2019
@busunkim96

Copy link
Copy Markdown
Contributor

@tswast Gentle ping to see if there are any updates on this PR.

@tswast

Copy link
Copy Markdown
ContributorAuthor

@busunkim96 I've worked with @sduskis to allocate some contractor resources for the necessary code sample updates before we unleash this PR.

Is it an issue if we keep this open for now?

@busunkim96

Copy link
Copy Markdown
Contributor

@tswast Nope, I just wanted to check. 😸 Thanks!

@yoshi-automationyoshi-automation removed the 🚨 This issue needs some love. label Jul 3, 2019
@tswasttswast closed this Dec 27, 2019
@tswast
tswast deleted the bq-dot-dataset-deprecation branch December 27, 2019 21:21
@tswast
tswast restored the bq-dot-dataset-deprecation branch December 29, 2019 00:04
@tswasttswast reopened this Dec 29, 2019
@tswast
tswastforce-pushed the bq-dot-dataset-deprecation branch from 074af14 to 5a1bab8CompareJanuary 23, 2020 20:18
…Reference
Now that all client methods that take a `DatasetReference` or
`TableReference` also take a string, the `client.dataset()` method is
unnecessary and confusing.
@tswast
tswastforce-pushed the bq-dot-dataset-deprecation branch from 5a1bab8 to cec97ffCompareJanuary 23, 2020 20:19
@tswasttswast changed the title Document client.dataset() deprecation.deprecate(bigquery): deprecate client.dataset() in favor of DatasetReferenceJan 23, 2020
@tswast
tswast marked this pull request as ready for review January 23, 2020 20:20
@tswast
tswast requested review from a team, plamut and shollymanJanuary 23, 2020 20:20

@plamutplamut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are still a lot of client.dataset() calls in snippets.py, but that file is deprecated, IIRC.

The rest looks good, aside from a remark on a possible grammar thingy.

Comment on lines +360 to +363
This method is deprecated. Construct a
:class:`~google.cloud.bigquery.dataset.DatasetReference` using its
constructor or use a string where previously a reference object was
used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it make sense to use the standard Sphinx directive for deprecations?
The text itself is already clear, though.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Doesn't appear to change formatting all that much:

image

Pushed the change in case it makes things a little more machine-readable or something, though.

Comment threadbigquery/google/cloud/bigquery/client.py Outdated
@plamut

plamut commented Jan 24, 2020

Copy link
Copy Markdown
Contributor

The test_client_load_partitioned_table snippet test failure could be unrelated, happens on another PR, too.

Might still be worth investigating, though.

Edit: Also happens on master, thus indeed unrelated to this PR.

Update:#10195 fixes it.

Co-Authored-By: Peter Lamut <plamut@users.noreply.github.com>
@tswast

Copy link
Copy Markdown
ContributorAuthor

There are still a lot of client.dataset() calls in snippets.py, but that file is deprecated, IIRC.

That's right. We're moving those samples to the samples/ directory and updating them to avoid the use of client.dataset(). I'm hoping that with #10175 and #10176 we'll have enough snippets updated.

@plamutplamut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good now. 👍

@plamut
plamut merged commit 7e36fda into googleapis:masterJan 27, 2020
@tswast
tswast deleted the bq-dot-dataset-deprecation branch January 27, 2020 16:22
This was referenced Jan 29, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BigQuery: deprecate client.dataset()

5 participants

@tswast@busunkim96@plamut@googlebot@yoshi-automation