FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Retry 400s during dataset teardown. by tseaver · Pull Request #2333 · googleapis/google-cloud-python · GitHub

Retry 400s during dataset teardown. - #2333

Merged
tseaver merged 2 commits into
googleapis:masterfrom
tseaver:2318-bigquery-dataset-still-in-use
Sep 16, 2016
Merged

Retry 400s during dataset teardown.#2333
tseaver merged 2 commits into
googleapis:masterfrom
tseaver:2318-bigquery-dataset-still-in-use

Conversation

tseaver commented Sep 16, 2016

Copy link
Copy Markdown
Contributor

Closes #2318.

tseaver added api: bigquery Issues related to the BigQuery API. flaky labels Sep 16, 2016
googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 16, 2016
Comment thread system_tests/bigquery.py Outdated
if isinstance(doomed, Bucket):
retry = RetryErrors(Conflict)
retry(doomed.delete)(force=True)
retry_409 = RetryErrors(Conflict)

This comment was marked as spam.

This comment was marked as spam.

Comment thread system_tests/bigquery.py Outdated
retry_409(doomed.delete)(force=True)
else:
doomed.delete()
retry_400(doomed.delete)()

This comment was marked as spam.

This comment was marked as spam.

dhermes commented Sep 16, 2016

Copy link
Copy Markdown
Contributor

@tseaver Were you able to reproduce this locally?

tseaver commented Sep 16, 2016

Copy link
Copy Markdown
Contributor Author

Were you able to reproduce this locally?

Not except by borking the delete of tables in the dataset.

dhermes commented Sep 16, 2016
edited
Loading

Copy link
Copy Markdown
Contributor

Gotcher. Thanks for the tip. Can you add an error predicate, e.g.

def err_pred(exc):
    return (len(exc._errors) == 1 and 
            exc._errors[0]['reason'] == 'resourceInUse')

Here is the output from catching that error:

>>> try:
...     dataset.delete()
... except Exception as exc:
...     pass
...
>>> import json
>>> print(json.dumps(exc.__dict__, indent=2))
{
  "message": "Dataset {PROJ}:create_table{TESTID} is still in use (DELETE https://www.googleapis.com/bigquery/v2/projects/{PROJ}/datasets/create_table{TESTID})",
  "_errors": [
    {
      "domain": "global",
      "message": "Dataset {PROJ}:create_table{TESTID} is still in use",
      "reason": "resourceInUse"
    }
  ]
}

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

tseaver merged commit 613361c into googleapis:master Sep 16, 2016
tseaver deleted the 2318-bigquery-dataset-still-in-use branch September 16, 2016 22:21
dhermes mentioned this pull request Sep 19, 2016
parthea pushed a commit that referenced this pull request Mar 2, 2026
Thank you for opening a Pull Request! Before submitting your PR, there
are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/python-bigquery/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Mar 2, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.7.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:c8612d3fffb3f6a32353b2d1abd16b61e87811866f7ec9d65b59b02eb452a620
<details><summary>google-cloud-bigquery: 3.40.0</summary>

##
[3.40.0](googleapis/python-bigquery@v3.39.0...v3.40.0)
(2026-01-08)

### Features

* support load_table and list_rows with picosecond timestamp (#2351)
([46764a59](googleapis/python-bigquery@46764a59))

* support timestamp_precision in table schema (#2333)
([8d5785ae](googleapis/python-bigquery@8d5785ae))

</details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL