Skip to content

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

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

Merged
merged 103 commits into from
Jul 22, 2020

Conversation

plamut
Copy link
Contributor

@plamut plamut commented Jul 21, 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.
Supersedes #148 (regenerates latest samples from scratch).

@google-cla
Copy link

google-cla bot commented Jul 21, 2020

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.

@google-cla google-cla bot added the cla: no This human has *not* signed the Contributor License Agreement. label Jul 21, 2020
@plamut plamut added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 21, 2020
@google-cla
Copy link

google-cla bot commented Jul 21, 2020

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.

@plamut plamut added the type: docs Improvement to the documentation for an API. label Jul 21, 2020
@google-cla
Copy link

google-cla bot commented Jul 21, 2020

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.

@plamut plamut removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 21, 2020
@plamut plamut requested review from busunkim96 and shollyman July 21, 2020 15:42
@plamut
Copy link
Contributor Author

plamut commented Jul 21, 2020

I would need some CI insight here, I can't see the samples log to see why those checks failed. Are the failures the same as in the "samples" session of the main noxfile?

Importing IPython fails, even though it was added to samples dependencies and samples tests pass locally (using the samples/snippets noxfile). Ditto for the missing GOOGLE_CLOUD_PROJECT env variable.

Also, should the snippets session now be removed from the main noxfile?

@busunkim96
Copy link
Contributor

CI seems to be falling over during the setup stage. This usually happens when the path to the build script is misconfigured.

[08:05:42] FATAL: Build script missing in checked out sources
[08:05:42] Failed to start execution
[08:05:42] hudson.AbortException: Build script does not exist: /tmp/workspace/workspace/cloud-devrel/client-libraries/python/googleapis/python-bigquery/samples/python3.6/presubmit/src/github/python-bigquery/.kokoro/trampoline.sh

Will submit a PR to fix this, once I've figured out which config it is 😄

@busunkim96 busunkim96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 21, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 21, 2020
@busunkim96 busunkim96 added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jul 21, 2020
@busunkim96
Copy link
Contributor

@plamut Once all the samples are being tested via a samples noxfile you can delete the extra session in the main noxfile.

That said, I see there are existing samples in the base samples directory. Is it okay to move those into the samples/snippets directory so they get tested? Should they be grouped into some other directory? @shollyman

@shollyman
Copy link
Contributor

Yeah, we'll need to move the existing samples. Happy to do this in a subsequent PR, since it also means we need to update all the include paths in the documentation site.

@google-cla
Copy link

google-cla bot commented Jul 22, 2020

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.

@google-cla google-cla bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Jul 22, 2020
@plamut
Copy link
Contributor Author

plamut commented Jul 22, 2020

It turned out that tests in samples/snippets were run by both the snippets session in the main noxfile and the py session in the local noxfile placed in that directory. Some of those tests failed, because the main session config sets up a slightly different environment.

A clean solution was to simply exclude samples/snippets from the main snippets run and moving the existing samples turned out to not even be necessary (at least for this particular PR). And we got rid of the test run duplication.


Side note - why does the CLA bot flip the label again even though the only new commits are mine, the PR sender, for which the bot already found the CLA?

@plamut plamut force-pushed the add-snippets-samples-2 branch from 3dbc5bf to 08b0ecb Compare July 22, 2020 07:20
@google-cla
Copy link

google-cla bot commented Jul 22, 2020

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.

@plamut plamut force-pushed the add-snippets-samples-2 branch from 08b0ecb to 5c70a0c Compare July 22, 2020 07:21
@google-cla
Copy link

google-cla bot commented Jul 22, 2020

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.

1 similar comment
@google-cla
Copy link

google-cla bot commented Jul 22, 2020

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.

@busunkim96 busunkim96 added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jul 22, 2020
shollyman and others added 21 commits July 22, 2020 21:46
…49)](GoogleCloudPlatform/python-docs-samples#3049)

* chore(deps): update dependency google-cloud-bigquery to v1.24.0

* chore(deps): update ipython version

* fix: fix requirements order

* explicitly add grpc to resolve errors

* adjust arguments

* undo mistake

* bump auth version

Co-authored-by: Bu Sun Kim <[email protected]>
Co-authored-by: Leah Cole <[email protected]>
Co-authored-by: Leah E. Cole <[email protected]>
Co-authored-by: Christopher Wilcox <[email protected]>
…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).
…thon-docs-samples#4189)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ipython](https://ipython.org) ([source](https://togithub.com/ipython/ipython)) | minor | `==7.15.0` -> `==7.16.1` |

---

### Release Notes

<details>
<summary>ipython/ipython</summary>

### [`v7.16.1`](https://togithub.com/ipython/ipython/compare/7.16.0...7.16.1)

[Compare Source](https://togithub.com/ipython/ipython/compare/7.16.0...7.16.1)

### [`v7.16.0`](https://togithub.com/ipython/ipython/compare/7.15.0...7.16.0)

[Compare Source](https://togithub.com/ipython/ipython/compare/7.15.0...7.16.0)

</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).
…Platform/python-docs-samples#4279)

* chore(deps): update dependency pytest to v5.4.3

* specify pytest for python 2 in appengine

Co-authored-by: Leah Cole <[email protected]>
…rm/python-docs-samples#4287)

* chore(deps): update dependency mock to v4

* specify mock version for appengine python 2

Co-authored-by: Leah Cole <[email protected]>
@plamut plamut force-pushed the add-snippets-samples-2 branch from 824862f to a42eff1 Compare July 22, 2020 19:54
@google-cla
Copy link

google-cla bot commented Jul 22, 2020

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.

@google-cla google-cla bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Jul 22, 2020
@plamut
Copy link
Contributor Author

plamut commented Jul 22, 2020

@busunkim96 @shollyman Please just flip the CLA label again, and I think we can merge this, yay. Thanks!

(had to manually rebase the entire branch, as GitHub did not allow me to "rebase and merge" due to a trivial conflict in one of the very old commits)

@shollyman shollyman added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jul 22, 2020
@shollyman shollyman merged commit 1ec41ef into googleapis:master Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has 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