Skip to content

docs: add samples from bigquery/cloud-client #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 109 commits into from

Conversation

plamut
Copy link
Contributor

@plamut plamut commented Jun 25, 2020

Samples from https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/bigquery/cloud-client


IMPORTANT: When merging, use the rebase and merge option to preserve the samples commit history!


NOTE: There are also other bigquery-related samples in the samples repo. If any others besides cloud-client need to be moved here, please let me know and I'll open additional PRs.

Closes #149.
Towards #147.

tswast and others added 30 commits August 10, 2016 14:49
…rm/python-docs-samples#444)

Put them in their own directory, since they duplicate the content from
the existing samples that use the generated libraries.
Change-Id: Ie78c06c7375f11dc2a98e2e8cf601f3820c6f0c1
Change-Id: I148b9f444ad5e481d4f091b53121873b51de191e
Change-Id: I5e3f3faecfaf05749e7cd931d1d81758d3032651
Change-Id: I957fa992850ed3305dbcad5cd73ed61a7eedb63c
Change-Id: If7b90925c51b739a293fad737c8ab6919b3f7eae
Change-Id: I74627bc2744d3b0946d34c1d2a04c424ed708e87
…CloudPlatform/python-docs-samples#514)

* Add bigquery create table sample
* Add copy table sample
* Fix test table ids
Change-Id: I3779282126cdd05b047194d356932b9995484115
Change-Id: Ie385fd8105325c6f2754b737e0f11c84254bcb47
Change-Id: I5bcb3d41bed33f638e5dba13da3335adfbdc2ead
Change-Id: If721ff085eb502b679a8decd3a39ac112425a114
…tform/python-docs-samples#699)

Available in latest version of google-cloud-bigquery (0.22.0), so
upgrades the requirement, too.
…thon-docs-samples#887)

* Remove cloud config fixture

* Fix client secrets

* Fix bigtable instance
renovate-bot and others added 8 commits April 28, 2020 06:05
…oudPlatform/python-docs-samples#4024)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [google-cloud-bigquery](https://togithub.com/googleapis/python-bigquery) | minor | `==1.24.0` -> `==1.25.0` |

---

### Release Notes

<details>
<summary>googleapis/python-bigquery</summary>

### [`v1.25.0`](https://togithub.com/googleapis/python-bigquery/blob/master/CHANGELOG.md#&#8203;1250-httpswwwgithubcomgoogleapispython-bigquerycomparev1240v1250-2020-06-06)

[Compare Source](https://togithub.com/googleapis/python-bigquery/compare/v1.24.0...v1.25.0)

##### Features

-   add BigQuery storage client support to DB API ([#&#8203;36](https://www.github.com/googleapis/python-bigquery/issues/36)) ([ba9b2f8](https://www.github.com/googleapis/python-bigquery/commit/ba9b2f87e36320d80f6f6460b77e6daddb0fa214))
-   **bigquery:** add create job method ([#&#8203;32](https://www.github.com/googleapis/python-bigquery/issues/32)) ([2abdef8](https://www.github.com/googleapis/python-bigquery/commit/2abdef82bed31601d1ca1aa92a10fea1e09f5297))
-   **bigquery:** add support of model for extract job ([#&#8203;71](https://www.github.com/googleapis/python-bigquery/issues/71)) ([4a7a514](https://www.github.com/googleapis/python-bigquery/commit/4a7a514659a9f6f9bbd8af46bab3f8782d6b4b98))
-   add HOUR support for time partitioning interval ([#&#8203;91](https://www.github.com/googleapis/python-bigquery/issues/91)) ([0dd90b9](https://www.github.com/googleapis/python-bigquery/commit/0dd90b90e3714c1d18f8a404917a9454870e338a))
-   add support for policy tags ([#&#8203;77](https://www.github.com/googleapis/python-bigquery/issues/77)) ([38a5c01](https://www.github.com/googleapis/python-bigquery/commit/38a5c01ca830daf165592357c45f2fb4016aad23))
-   make AccessEntry objects hashable ([#&#8203;93](https://www.github.com/googleapis/python-bigquery/issues/93)) ([23a173b](https://www.github.com/googleapis/python-bigquery/commit/23a173bc5a25c0c8200adc5af62eb05624c9099e))
-   **bigquery:** expose start index parameter for query result ([#&#8203;121](https://www.github.com/googleapis/python-bigquery/issues/121)) ([be86de3](https://www.github.com/googleapis/python-bigquery/commit/be86de330a3c3801653a0ccef90e3d9bdb3eee7a))
-   **bigquery:** unit and system test for dataframe with int column with Nan values  ([#&#8203;39](https://www.github.com/googleapis/python-bigquery/issues/39)) ([5fd840e](https://www.github.com/googleapis/python-bigquery/commit/5fd840e9d4c592c4f736f2fd4792c9670ba6795e))

##### Bug Fixes

-   allow partial streaming_buffer statistics ([#&#8203;37](https://www.github.com/googleapis/python-bigquery/issues/37)) ([645f0fd](https://www.github.com/googleapis/python-bigquery/commit/645f0fdb35ee0e81ee70f7459e796a42a1f03210))
-   distinguish server timeouts from transport timeouts ([#&#8203;43](https://www.github.com/googleapis/python-bigquery/issues/43)) ([a17be5f](https://www.github.com/googleapis/python-bigquery/commit/a17be5f01043f32d9fbfb2ddf456031ea9205c8f))
-   improve cell magic error message on missing query ([#&#8203;58](https://www.github.com/googleapis/python-bigquery/issues/58)) ([6182cf4](https://www.github.com/googleapis/python-bigquery/commit/6182cf48aef8f463bb96891cfc44a96768121dbc))
-   **bigquery:** fix repr of model reference ([#&#8203;66](https://www.github.com/googleapis/python-bigquery/issues/66)) ([26c6204](https://www.github.com/googleapis/python-bigquery/commit/26c62046f4ec8880cf6561cc90a8b821dcc84ec5))
-   **bigquery:** fix start index with page size for list rows ([#&#8203;27](https://www.github.com/googleapis/python-bigquery/issues/27)) ([400673b](https://www.github.com/googleapis/python-bigquery/commit/400673b5d0f2a6a3d828fdaad9d222ca967ffeff))

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
…loudPlatform/python-docs-samples#4118)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [matplotlib](https://matplotlib.org) ([source](https://togithub.com/matplotlib/matplotlib)) | patch | `==3.2.1` -> `==3.2.2` |

---

### Release Notes

<details>
<summary>matplotlib/matplotlib</summary>

### [`v3.2.2`](https://togithub.com/matplotlib/matplotlib/releases/v3.2.2)

[Compare Source](https://togithub.com/matplotlib/matplotlib/compare/v3.2.1...v3.2.2)

This is the second bugfix release of the 3.2.x series.

This release contains several critical bug-fixes:

-   support fractional HiDPI scaling with Qt backends
-   support new Python and fix syntax errors in legacy Python
-   support new Qt 5 and fix support for Qt 4
-   fix animation writer fallback
-   fix figure resizing
-   fix handling of large arcs
-   fix issues with tight layout
-   fix saving figures after closing windows or under certain size conditions
-   fix scatter when specifying a single color
-   fix several memory leaks
-   fix unexpected autoscaling behavior
-   fix various issues with usetex
-   various minor bug and documentation fixes

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/python-docs-samples).
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Jun 25, 2020
@plamut plamut added the type: docs Improvement to the documentation for an API. label Jun 25, 2020
@plamut plamut requested a review from busunkim96 June 25, 2020 13:57
@plamut
Copy link
Contributor Author

plamut commented Jun 25, 2020

@steffnay Does this PR affect the announced changes to the existing BigQuery samples in the repo in any way?

IIRC the existing sample files will be renamed, and this PR only adds new snippets from the common samples repo, but nevertheless asking, just in case.


Unrelated - somebody will have to manually check and confirm that CLAs are in order, I don't have that power.

@plamut
Copy link
Contributor Author

plamut commented Jun 26, 2020

A few problems:

  • The new template (generated in a synth run) docs/samples/AUTHORING_GUIDE.md is not included anywhere, resulting in a docs warning (treated as error).
  • IPython import error in samples/snippets/jupyter_tutorial_test.py for some reason.
  • GOOGLE_CLOUD_PROJECT env variable not set (or the expected variable name needs to be changed in the generated snippets noxfile)

Are these known or are do we have to do a few other tweaks in the BQ library itself?

@busunkim96
Copy link
Contributor

  • The new template (generated in a synth run) docs/samples/AUTHORING_GUIDE.md is not included anywhere, resulting in a docs warning (treated as error).

Ah, I think the logic in synthtool is getting confused because there's a link tosamples inside the docs directory. The intended home for the AUTHORING_GUIDE.md is samples/AUTHORING_GUIDE.md.

It looks like there are already samples in this repo, anyone have context on what the relationship between https://github.com/googleapis/python-bigquery/tree/master/samples and the ones in python-docs-samples? @shollyman?

  • IPython import error in samples/snippets/jupyter_tutorial_test.py for some reason.

No idea what's happening here, maybe a missing requirement?

  • GOOGLE_CLOUD_PROJECT env variable not set (or the expected variable name needs to be changed in the generated snippets noxfile)

I think if you delete samples/snippets/noxfile_config.py the default project will be used. (I might have borked the templates though, we can check once the samples sessions run against this PR).

@steffnay
Copy link
Contributor

@plamut This should be fine. We can just include these files when we go through and check all the region tags/file names.

Copy link
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

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

Approving this based on my understanding that it's a "move with history" from the other repo. I know PR 145 also landed some of these config files as part of a config push, unclear how gnarly the merge will be (hopefully no-op).

@plamut
Copy link
Contributor Author

plamut commented Jul 16, 2020

I'll re-visit this in a few days and compare the state of it with the steps outlined in the samples migration guide. IIRC separate Kokoro jobs from samples need to be created (via code re-gen ... or maybe as a separate step after the merge, can't remember now).

Other than that, it's primarily moving the samples (with history) from the other repo, yes.

@plamut plamut force-pushed the add-snippets-samples branch from e76c985 to 62dc5e8 Compare July 21, 2020 12:01
@plamut plamut force-pushed the add-snippets-samples branch from 6990baa to ac1ab92 Compare July 21, 2020 12:59
@plamut
Copy link
Contributor Author

plamut commented Jul 21, 2020

Closing in favor of #174.

(regenerated samples from scratch, although it appears that this also does not solve the CI failures)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: no This human has *not* signed the Contributor License Agreement. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add bigquery/cloud-client samples from the samples repo